summaryrefslogtreecommitdiff
path: root/framework/source/helper/persistentwindowstate.cxx
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2021-03-30 15:00:49 -0400
committerAndras Timar <andras.timar@collabora.com>2021-04-19 20:06:21 +0200
commit697a112334f7bba510f4ca2fd3ac83670ecf06a0 (patch)
tree10be0d2659ffb163b11aea0806ea472eb4b34bc5 /framework/source/helper/persistentwindowstate.cxx
parent499ccf5be8812b09665d5f29aabe706509c5bcbf (diff)
lok: remove frame action listener when disposing
In order to prevent that the frame action listener holds the object reference count when removed, ensure they are removed when disposing the object. Change-Id: If83574e31230d9c683adaf36af36485650fd2c50 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113389 Tested-by: Jenkins Reviewed-by: Henry Castro <hcastro@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113455 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'framework/source/helper/persistentwindowstate.cxx')
-rw-r--r--framework/source/helper/persistentwindowstate.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/framework/source/helper/persistentwindowstate.cxx b/framework/source/helper/persistentwindowstate.cxx
index aad137074d98..08e33ac527ef 100644
--- a/framework/source/helper/persistentwindowstate.cxx
+++ b/framework/source/helper/persistentwindowstate.cxx
@@ -136,6 +136,10 @@ void SAL_CALL PersistentWindowState::frameAction(const css::frame::FrameActionEv
void SAL_CALL PersistentWindowState::disposing(const css::lang::EventObject&)
{
+ css::uno::Reference< css::frame::XFrame > xFrame(m_xFrame.get(), css::uno::UNO_QUERY);
+ if (xFrame.is())
+ xFrame->removeFrameActionListener(this);
+
// nothing todo here - because we hold the frame as weak reference only
}