From c4de35ab55f7782646ddd322092f9e1326451aa1 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 3 Aug 2011 16:28:58 +0100 Subject: fix this leak again post-merge --- .../hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'lingucomponent/source/hyphenator') diff --git a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx index 6190355485e8..1f8a5089efce 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; + } } } -- cgit