summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-08-17 09:13:12 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-08-17 09:13:43 +0200
commit047ebb1dadcc0219a268455f74fc03a23aa3d86d (patch)
tree83aa6c4d23fd0d04494608e8566a9f4612968f93
parent42fc4f102bc848cf2d41ce33788c802af099b4d3 (diff)
tdf#93284 vcl: fix VirtualDevice leaks in the WMF filter
We attempted to have 8884 VirtualDevices in parallel. This number is now 12 after fixing the leaks. The original bugdoc has 135 images, 76 is enough to make Writer on Windows crash. The minimized document has the same WMF data for all the images, but still duplicated inside the ZIP container, so we trigger the resource limit, but the document is still just 99K. Change-Id: I4c6b3853eaf688302323daf67ff7b62dd64fc412
-rwxr-xr-xsw/qa/core/data/ooxml/pass/tdf93284.docxbin0 -> 100647 bytes
-rw-r--r--vcl/source/filter/wmf/winmtf.cxx6
2 files changed, 3 insertions, 3 deletions
diff --git a/sw/qa/core/data/ooxml/pass/tdf93284.docx b/sw/qa/core/data/ooxml/pass/tdf93284.docx
new file mode 100755
index 000000000000..aedc026e8a10
--- /dev/null
+++ b/sw/qa/core/data/ooxml/pass/tdf93284.docx
Binary files differ
diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index 74a0774a458a..a768b329c92b 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -236,7 +236,7 @@ WinMtfFontStyle::WinMtfFontStyle( LOGFONTW& rFont )
{
// #i117968# VirtualDevice is not thread safe, but filter is used in multithreading
SolarMutexGuard aGuard;
- VclPtrInstance< VirtualDevice > pVDev;
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
// converting the cell height into a font height
aFont.SetSize( aFontSize );
pVDev->SetFont( aFont );
@@ -1451,7 +1451,7 @@ void WinMtfOutput::DrawText( Point& rPosition, OUString& rText, long* pDXArry, b
{
// #i117968# VirtualDevice is not thread safe, but filter is used in multithreading
SolarMutexGuard aGuard;
- VclPtrInstance< VirtualDevice > pVDev;
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
sal_Int32 nTextWidth;
pVDev->SetMapMode( MapMode( MAP_100TH_MM ) );
pVDev->SetFont( maFont );
@@ -1499,7 +1499,7 @@ void WinMtfOutput::DrawText( Point& rPosition, OUString& rText, long* pDXArry, b
{
// #i117968# VirtualDevice is not thread safe, but filter is used in multithreading
SolarMutexGuard aGuard;
- VclPtrInstance< VirtualDevice > pVDev;
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
pDX = new long[ rText.getLength() ];
pVDev->SetMapMode( MAP_100TH_MM );
pVDev->SetFont( maLatestFont );