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.vers...@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

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to