diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2017-01-26 22:45:48 -0500 |
---|---|---|
committer | Kohei Yoshida <libreoffice@kohei.us> | 2017-01-27 04:37:22 +0000 |
commit | fab2f546d1fb3ceaf5ee5d4d728f1728a8f1e7f3 (patch) | |
tree | 1ebdea9887082bd7933393072470bc9b305ea28a | |
parent | 2be42d9480fc831144e4d5b216b0a01ffbdb5c8f (diff) |
tdf#102688: prevent leaking of VirtualDevice instances.
Change-Id: I6fb8e5b7fc5c0cef8f7ab1f93f5096ad588d57c7
Reviewed-on: https://gerrit.libreoffice.org/33601
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
-rw-r--r-- | editeng/source/editeng/impedit.hxx | 1 | ||||
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 35121b5898c2..ffcda876992d 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -420,6 +420,7 @@ private: VclPtr< VirtualDevice> pVirtDev; VclPtr< OutputDevice > pRefDev; + VclPtr<VirtualDevice> mpOwnDev; svtools::ColorConfig* pColorConfig; mutable SvtCTLOptions* pCTLOptions; diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 1c56dfbaf18e..5bbb325cc854 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -176,6 +176,7 @@ ImpEditEngine::~ImpEditEngine() bDowning = true; SetUpdateMode( false ); + mpOwnDev.disposeAndClear(); pVirtDev.disposeAndClear(); delete pEmptyItemSet; delete pUndoManager; @@ -207,7 +208,8 @@ void ImpEditEngine::SetRefMapMode( const MapMode& rMapMode ) if ( GetRefDevice()->GetMapMode() == rMapMode ) return; - pRefDev = VclPtr<VirtualDevice>::Create(); + mpOwnDev = VclPtr<VirtualDevice>::Create(); + pRefDev = mpOwnDev; pRefDev->SetMapMode( MapUnit::MapTwip ); SetRefDevice( pRefDev ); |