[Libreoffice-commits] .: lingucomponent/source

Caolán McNamara caolan at kemper.freedesktop.org
Wed Aug 3 08:34:17 PDT 2011


 lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx |   18 ++++++----
 lingucomponent/source/spellcheck/spell/sspellimp.cxx               |   11 ++++++
 lingucomponent/source/thesaurus/libnth/nthesimp.cxx                |   11 +++++-
 3 files changed, 32 insertions(+), 8 deletions(-)

New commits:
commit 3392a231892694622cae947f8e6186d4d4b1119f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Aug 3 16:28:58 2011 +0100

    fix this leak again post-merge

diff --git a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx
index 040232b..77485ac 100644
--- a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx
+++ b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx
@@ -97,9 +97,6 @@ Hyphenator::Hyphenator() :
 
 Hyphenator::~Hyphenator()
 {
-    if (pPropHelper)
-        pPropHelper->RemoveAsPropListener();
-
     if (numdict && aDicts)
     {
         for (int i=0; i < numdict; ++i)
@@ -108,10 +105,14 @@ Hyphenator::~Hyphenator()
             if (aDicts[i].aPtr)
                 hnj_hyphen_free(aDicts[i].aPtr);
         }
-	delete pPropHelper;
     }
-
     delete[] aDicts;
+
+    if (pPropHelper)
+    {
+        pPropHelper->RemoveAsPropListener();
+        delete pPropHelper;
+    }
 }
 
 PropertyHelper_Hyphenation& Hyphenator::GetPropHelper_Impl()
@@ -124,7 +125,6 @@ PropertyHelper_Hyphenation& Hyphenator::GetPropHelper_Impl()
         pPropHelper->AddAsPropListener();	//! after a reference is established
     }
     return *pPropHelper;
-
 }
 
 
@@ -870,6 +870,12 @@ void SAL_CALL Hyphenator::dispose()
         bDisposing = sal_True;
         EventObject	aEvtObj( (XHyphenator *) this );
         aEvtListeners.disposeAndClear( aEvtObj );
+        if (pPropHelper)
+        {
+            pPropHelper->RemoveAsPropListener();
+            delete pPropHelper;
+            pPropHelper = NULL;
+        }
     }
 }
 
diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
index 13246bd..52d22af 100644
--- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx
+++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
@@ -107,6 +107,11 @@ SpellChecker::~SpellChecker()
     aDLocs = NULL;
     delete[] aDNames;
     aDNames = NULL;
+    if (pPropHelper)
+    {
+        pPropHelper->RemoveAsPropListener();
+        delete pPropHelper;
+    }
 }
 
 PropertyHelper_Spelling & SpellChecker::GetPropHelper_Impl()
@@ -594,6 +599,12 @@ void SAL_CALL SpellChecker::dispose()
         bDisposing = sal_True;
         EventObject	aEvtObj( (XSpellChecker *) this );
         aEvtListeners.disposeAndClear( aEvtObj );
+        if (pPropHelper)
+        {
+            pPropHelper->RemoveAsPropListener();
+            delete pPropHelper;
+            pPropHelper = NULL;
+        }
     }
 }
 
diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
index ccbf55f..5d207ca 100644
--- a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
+++ b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
@@ -108,7 +108,6 @@ Thesaurus::Thesaurus() :
 
 Thesaurus::~Thesaurus()
 {
-
     if (aThes) 
     {
         for (int i = 0; i < numthes; i++) 
@@ -138,8 +137,10 @@ Thesaurus::~Thesaurus()
     aTNames = NULL;
 
     if (pPropHelper)
+    {
         pPropHelper->RemoveAsPropListener();
-	delete pPropHelper;
+        delete pPropHelper;
+    }
 }
 
 
@@ -686,6 +687,12 @@ void SAL_CALL Thesaurus::dispose()
         bDisposing = sal_True;
         EventObject	aEvtObj( (XThesaurus *) this );
         aEvtListeners.disposeAndClear( aEvtObj );
+        if (pPropHelper)
+        {
+            pPropHelper->RemoveAsPropListener();
+            delete pPropHelper;
+            pPropHelper = NULL;
+        }
     }
 }
 


More information about the Libreoffice-commits mailing list