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


Hi,

This patch add a virtual destructor to all classes from
WW8ResourceModel.hxx with virtual methods to prevent memory leaks likes rtf
few days ago almost from docx import filter.

Thanks

Best regards

-- 
Arnaud Versini
From c2054880238124c6cdc9b1fe7d14e9b10721decb Mon Sep 17 00:00:00 2001
From: Arnaud Versini <arnaud.versini@gmail.com>
Date: Tue, 13 Mar 2012 20:41:38 +0100
Subject: [PATCH] Adding virtual destructor to WW8ResourceModel.hxx classes

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

diff --git a/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx 
b/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx
index 9504b6f..5869f04 100644
--- a/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx
+++ b/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx
@@ -128,6 +128,9 @@ class Sprm;
 class WRITERFILTER_RESOURCEMODEL_DLLPUBLIC Properties
 {
 public:
+
+    virtual ~Properties() {}
+
     /**
        Receives an attribute.
 
@@ -152,6 +155,8 @@ class WRITERFILTER_RESOURCEMODEL_DLLPUBLIC Table
 {
 public:
     typedef boost::shared_ptr<Table> Pointer_t;
+
+    virtual ~Table() {}
     /**
        Receives an entry of the table.
 
@@ -167,6 +172,8 @@ public:
 class WRITERFILTER_RESOURCEMODEL_DLLPUBLIC BinaryObj
 {
 public:
+
+    virtual ~BinaryObj() {}
     /**
        Receives binary data of the object.
 
@@ -184,11 +191,14 @@ public:
 class WRITERFILTER_RESOURCEMODEL_DLLPUBLIC Stream
 {
 public:
+
     /**
        Pointer to this stream.
      */
     typedef boost::shared_ptr<Stream> Pointer_t;
 
+    virtual ~Stream() {}
+
     /**
        Receives start mark for group with the same section properties.
      */
@@ -344,6 +354,9 @@ public:
     typedef auto_ptr<Sprm> Pointer_t;
     SAL_WNODEPRECATED_DECLARATIONS_POP
     enum Kind { UNKNOWN, CHARACTER, PARAGRAPH, TABLE };
+
+    virtual ~Sprm() {}
+
     /**
        Returns id of the SPRM.
      */
-- 
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.