summaryrefslogtreecommitdiff
path: root/vcl/win/source
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-08-28 18:37:37 +0200
committerMichael Stahl <mstahl@redhat.com>2015-08-28 20:42:45 +0200
commit34700400247e378e074ce4164ab2809edb092201 (patch)
treeb391b7dde601ccf2efb2e84759301a946bbb9973 /vcl/win/source
parentd421ba3b665e6175e3ccfec7397e5f203f3ed54b (diff)
vcl: fix resource management issue in WinSalLayout
Since commit 65a66d41fd0e13d0aad9df935091b731b4af650a the sd_exports_test crashes on Windows in UniscribeLayout because it uses a ImplFontEntry that has been removed from the font cache. Tweak the refcount in WinLayout so it will be valid. Change-Id: Ic4bf984ea9fd70de9fa95ca964ae12d95d47d5bf
Diffstat (limited to 'vcl/win/source')
-rw-r--r--vcl/win/source/gdi/winlayout.cxx10
-rw-r--r--vcl/win/source/gdi/winlayout.hxx1
2 files changed, 10 insertions, 1 deletions
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index 19aa22fc2e20..8d5d8bd50d63 100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -29,6 +29,7 @@
#include <vcl/opengl/OpenGLHelper.hxx>
#include <win/salgdi.h>
#include <win/saldata.hxx>
+#include <outdev.h>
#include "sft.hxx"
#include "sallayout.hxx"
@@ -454,7 +455,14 @@ WinLayout::WinLayout(HDC hDC, const ImplWinFontData& rWFD, ImplWinFontEntry& rWF
mrWinFontData( rWFD ),
mrWinFontEntry(rWFE),
mbUseOpenGL(bUseOpenGL)
-{}
+{
+ ++mrWinFontEntry.mnRefCount; // keep it alive
+}
+
+WinLayout::~WinLayout()
+{
+ mrWinFontEntry.m_pFontCache->Release(&mrWinFontEntry);
+}
void WinLayout::InitFont() const
{
diff --git a/vcl/win/source/gdi/winlayout.hxx b/vcl/win/source/gdi/winlayout.hxx
index 8855e37478c7..d558d4cc6bc2 100644
--- a/vcl/win/source/gdi/winlayout.hxx
+++ b/vcl/win/source/gdi/winlayout.hxx
@@ -41,6 +41,7 @@ class WinLayout : public SalLayout
{
public:
WinLayout(HDC, const ImplWinFontData&, ImplWinFontEntry&, bool bUseOpenGL);
+ virtual ~WinLayout();
virtual void InitFont() const SAL_OVERRIDE;
void SetFontScale( float f ) { mfFontScale = f; }
HFONT DisableFontScaling() const;