summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-05-23 19:59:55 +0100
committerMichael Meeks <michael.meeks@collabora.com>2015-05-26 14:05:10 +0100
commit41b234cfa52c9e41b1780d4686a140bcc1c7b27a (patch)
treecdbce023e77a04e7dd714ae01867660dfa9e1700
parentfbe4e09bd1c97585ff98084788e1e5066773a1ce (diff)
tdf#91499 - cleanup AnyRefDialog VclPtr's with an explicit dispose method.
Change-Id: Ib3571fc6d2aa9343bcfd2d6a5bdbd6b1d193c0f1 Reviewed-on: https://gerrit.libreoffice.org/15883 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
-rw-r--r--sc/source/ui/inc/anyrefdg.hxx10
-rw-r--r--sc/source/ui/miscdlgs/anyrefdg.cxx7
2 files changed, 16 insertions, 1 deletions
diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx
index 5bcc688a96d4..5f717ffd6a67 100644
--- a/sc/source/ui/inc/anyrefdg.hxx
+++ b/sc/source/ui/inc/anyrefdg.hxx
@@ -127,6 +127,7 @@ private:
DECL_LINK_TYPED( UpdateFocusHdl, Idle*, void );
protected:
+ void disposeRefHandler();
bool DoClose( sal_uInt16 nId );
static void SetDispatcherLock( bool bLock );
@@ -280,9 +281,16 @@ struct ScRefHdlrImpl: ScRefHdlrImplBase< TBase, bBindRef >
SC_MOD()->RegisterRefWindow( static_cast<sal_uInt16>( static_cast<TDerived*>(this)->SLOTID ), this );
}
- ~ScRefHdlrImpl()
+ virtual void dispose() SAL_OVERRIDE
{
SC_MOD()->UnregisterRefWindow( static_cast<sal_uInt16>( static_cast<TDerived*>(this)->SLOTID ), this );
+ ScRefHdlrImplBase<TBase, bBindRef >::disposeRefHandler();
+ TBase::dispose();
+ }
+
+ ~ScRefHdlrImpl()
+ {
+ dispose();
}
};
diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx
index 99d4f585fd45..34ecb427fab9 100644
--- a/sc/source/ui/miscdlgs/anyrefdg.cxx
+++ b/sc/source/ui/miscdlgs/anyrefdg.cxx
@@ -823,6 +823,13 @@ bool ScRefHandler::EnterRefMode()
ScRefHandler::~ScRefHandler()
{
+ disposeRefHandler();
+}
+
+void ScRefHandler::disposeRefHandler()
+{
+ m_rWindow.clear();
+ pActiveWin.clear();
LeaveRefMode();
}