[Libreoffice-commits] core.git: editeng/source

Kohei Yoshida kohei.yoshida at collabora.com
Fri Jan 27 04:37:49 UTC 2017


 editeng/source/editeng/impedit.hxx  |    1 +
 editeng/source/editeng/impedit2.cxx |    4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

New commits:
commit fab2f546d1fb3ceaf5ee5d4d728f1728a8f1e7f3
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Jan 26 22:45:48 2017 -0500

    tdf#102688: prevent leaking of VirtualDevice instances.
    
    Change-Id: I6fb8e5b7fc5c0cef8f7ab1f93f5096ad588d57c7
    Reviewed-on: https://gerrit.libreoffice.org/33601
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Kohei Yoshida <libreoffice at kohei.us>

diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 35121b5..ffcda87 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 1c56dfb..5bbb325 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 );
 


More information about the Libreoffice-commits mailing list