summaryrefslogtreecommitdiff
path: root/sdext
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-04-18 11:21:44 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-04-18 10:51:54 +0000
commit67d333c608a662621c1069aacdec75e45e33a183 (patch)
tree9b2715c5d159acc881627fe461c501fd4db91abf /sdext
parent0c1e6136ca84ec3bd2c0bb96689c0235b8585b25 (diff)
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')
-rw-r--r--sdext/source/pdfimport/wrapper/wrapper.cxx11
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;