Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hi

I'm not sure but Valgrind said that memories allocations in RTFValue are
not deleted, so this patch make Value's destructor virtual (parent of
RTFValue). With this patch, Valgrind doesn't detect leak on this anymore,
but I'm not sure about binary compatibility.

If this is the solution, I will check all others types wich have the same
usage.

Thanks in advance for the review

Best regards

-- 
Arnaud Versini
From 054a5d5bc90e9e825cb1a625e46b7c641de41523 Mon Sep 17 00:00:00 2001
From: Arnaud Versini <arnaud.versini@gmail.com>
Date: Sun, 11 Mar 2012 20:42:44 +0100
Subject: [PATCH] Add a virtual destrcutor to value to prevent memory leak in
 RTFValue

---
 .../inc/resourcemodel/WW8ResourceModel.hxx         |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx 
b/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx
index f452a83..9504b6f 100644
--- a/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx
+++ b/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx
@@ -295,6 +295,8 @@ public:
     typedef auto_ptr<Value> Pointer_t;
     SAL_WNODEPRECATED_DECLARATIONS_POP
 
+    virtual ~Value() {}
+
     /**
        Returns integer representation of the value.
      */
-- 
1.7.5.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.