diff options
author | Noel Grandin <noel@peralex.com> | 2016-04-18 11:21:44 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-04-18 10:51:54 +0000 |
commit | 67d333c608a662621c1069aacdec75e45e33a183 (patch) | |
tree | 9b2715c5d159acc881627fe461c501fd4db91abf /sdext/source | |
parent | Updated core (diff) | |
download | core-67d333c608a662621c1069aacdec75e45e33a183.tar.gz core-67d333c608a662621c1069aacdec75e45e33a183.zip |
tdf#99352 - Some VclPtrs leak past DeInitVCL
Change-Id: I74b27b1d8b662a644df580ae128643b8495355f8
Reviewed-on: https://gerrit.libreoffice.org/24204
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sdext/source')
-rw-r--r-- | sdext/source/pdfimport/wrapper/wrapper.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sdext/source/pdfimport/wrapper/wrapper.cxx b/sdext/source/pdfimport/wrapper/wrapper.cxx index 06a97635bee3..48e3924ef90d 100644 --- a/sdext/source/pdfimport/wrapper/wrapper.cxx +++ b/sdext/source/pdfimport/wrapper/wrapper.cxx @@ -59,6 +59,7 @@ #include <vcl/metric.hxx> #include <vcl/font.hxx> #include <vcl/virdev.hxx> +#include <vcl/lazydelete.hxx> #include <memory> #include <unordered_map> @@ -662,13 +663,13 @@ void Parser::readFont() } - static VclPtr<VirtualDevice> vDev; - if (!vDev) - vDev = VclPtr<VirtualDevice>::Create(); + static vcl::DeleteOnDeinit< VclPtr<VirtualDevice> > vDev( new VclPtr<VirtualDevice> ); + if (!vDev.get()->get()) + (*vDev.get()) = VclPtr<VirtualDevice>::Create(); vcl::Font font(aResult.familyName, Size(0, 1000)); - vDev->SetFont(font); - FontMetric metric(vDev->GetFontMetric()); + (*vDev.get())->SetFont(font); + FontMetric metric((*vDev.get())->GetFontMetric()); aResult.ascent = metric.GetAscent() / 1000.0; m_aFontMap[nFontID] = aResult; |