Kaydet (Commit) 9dd9208d authored tarafından Miklos Vajna's avatar Miklos Vajna Kaydeden (comit) Caolán McNamara

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 047ebb1d)
Reviewed-on: https://gerrit.libreoffice.org/17825Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst b6bd0111
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment