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

Mark Wielaard mark at klomp.org
Wed Jul 10 21:03:13 PDT 2013


 cppcanvas/source/mtfrenderer/emfplus.cxx |   12 ++++++++++++
 1 file changed, 12 insertions(+)

New commits:
commit cb14b1e56d2aab70d28afca8bf039a27f89671c8
Author: Mark Wielaard <mark at klomp.org>
Date:   Sun Jul 7 22:09:37 2013 +0200

    Fix memory leak in EMFPPen.
    
    Delete dashPattern, compoundArray, customStartCap and customEndCap
    arrays if they were created in the destructor.
    
    Change-Id: I5f3821b1ab0ac31a9cd4bc402c04090585953573
    Reviewed-on: https://gerrit.libreoffice.org/4821
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx
index d3b58aa..a8b08d2 100644
--- a/cppcanvas/source/mtfrenderer/emfplus.cxx
+++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
@@ -604,6 +604,18 @@ namespace cppcanvas
         public:
             EMFPPen () : EMFPBrush ()
             {
+                dashPattern = NULL;
+                compoundArray = NULL;
+                customStartCap = NULL;
+                customEndCap = NULL;
+            }
+
+            ~EMFPPen ()
+            {
+                delete[] dashPattern;
+                delete[] compoundArray;
+                delete[] customStartCap;
+                delete[] customEndCap;
             }
 
             void SetStrokeAttributes (rendering::StrokeAttributes& rStrokeAttributes, ImplRenderer& rR, const OutDevState& rState)


More information about the Libreoffice-commits mailing list