summaryrefslogtreecommitdiff
path: root/cppcanvas
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2013-07-07 22:09:37 +0200
committerDavid Tardon <dtardon@redhat.com>2013-07-11 04:02:51 +0000
commitcb14b1e56d2aab70d28afca8bf039a27f89671c8 (patch)
tree97fe4441b24f021a2fc19a8b961dc3633cea628b /cppcanvas
parent3f1a58884eba6a7cee5a208e0f3de768d1377398 (diff)
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@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'cppcanvas')
-rw-r--r--cppcanvas/source/mtfrenderer/emfplus.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx
index d3b58aa4b7ed..a8b08d2067e5 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)