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

Thorsten Behrens tbehrens at suse.com
Wed May 8 11:50:34 PDT 2013


 cppcanvas/source/inc/implrenderer.hxx         |    6 +++++-
 cppcanvas/source/mtfrenderer/emfplus.cxx      |    5 -----
 cppcanvas/source/mtfrenderer/implrenderer.cxx |    3 +++
 3 files changed, 8 insertions(+), 6 deletions(-)

New commits:
commit 569f6b41c6d7dcdcc65a2d6a75018a3266936532
Author: Thorsten Behrens <tbehrens at suse.com>
Date:   Wed May 8 20:37:45 2013 +0200

    Don't leak all of the EMF+ graphic objects.
    
    Change-Id: I7951a9d25da5feec997dd0643f8579f5bcd0ee0f

diff --git a/cppcanvas/source/inc/implrenderer.hxx b/cppcanvas/source/inc/implrenderer.hxx
index addcdc2..79a2967 100644
--- a/cppcanvas/source/inc/implrenderer.hxx
+++ b/cppcanvas/source/inc/implrenderer.hxx
@@ -54,9 +54,13 @@ namespace cppcanvas
     {
         struct OutDevState;
         struct ActionFactoryParameters;
-        struct EMFPObject;
         struct XForm;
 
+        struct EMFPObject
+        {
+            virtual ~EMFPObject() {}
+        };
+
         // state stack of OutputDevice, to correctly handle
         // push/pop actions
         class VectorOfOutDevStates
diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx
index 693a57c..c17c38e 100644
--- a/cppcanvas/source/mtfrenderer/emfplus.cxx
+++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
@@ -110,11 +110,6 @@ namespace cppcanvas
         }
 #endif
 
-        struct EMFPObject
-        {
-            virtual ~EMFPObject() {}
-        };
-
         struct EMFPPath : public EMFPObject
         {
             ::basegfx::B2DPolyPolygon    aPolygon;
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 635a5fb..5bc99a5 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -3038,6 +3038,9 @@ namespace cppcanvas
 
         ImplRenderer::~ImplRenderer()
         {
+            // don't leak EMFPObjects
+            for(unsigned int i=0; i<SAL_N_ELEMENTS(aObjects); ++i)
+                delete aObjects[i];
         }
 
         bool ImplRenderer::drawSubset( sal_Int32    nStartIndex,


More information about the Libreoffice-commits mailing list