summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-08-17 09:13:12 +0200
committerCaolán McNamara <caolanm@redhat.com>2015-08-18 09:23:51 +0000
commit9dd9208d54d64eb53d95853af725712229d41fad (patch)
tree6308b9cce74c1594fb24d0558862a3aa32614c98
parentb6bd0111073d0a94b40b20cce85e10cdcb791d3e (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 (cherry picked from commit 047ebb1dadcc0219a268455f74fc03a23aa3d86d) Reviewed-on: https://gerrit.libreoffice.org/17825 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-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 20e2b5c3a40f..c5d1cf99832b 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 );