summaryrefslogtreecommitdiff
path: root/vcl/source/window/dockmgr.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-02-26 12:04:50 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-02-26 20:57:04 +0100
commitbbb3f36877807a5f6106956d7497f281169d9421 (patch)
tree94d1d52fea91bdc833882f6b3580074bdaab56e7 /vcl/source/window/dockmgr.cxx
parent0efaa25ddfa84aa3fee88a357ff15f5ec50b234a (diff)
protect against callback destroying this object
Change-Id: I4527f9bf5f2983083be8055dfb6277ed2dcd8c39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111626 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/window/dockmgr.cxx')
-rw-r--r--vcl/source/window/dockmgr.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx
index 66eccfa36150..bdef0d5581ef 100644
--- a/vcl/source/window/dockmgr.cxx
+++ b/vcl/source/window/dockmgr.cxx
@@ -864,8 +864,10 @@ IMPL_LINK_NOARG(ImplDockingWindowWrapper, PopupModeEnd, FloatingWindow*, void)
xWindow->SetParent( pRealParent );
xWindow->mpWindowImpl->mpRealParent = pRealParent;
- maPopupModeEndHdl.Call(mpFloatWin);
- mpFloatWin.disposeAndClear();
+ // take ownership to local variable to protect against maPopupModeEndHdl destroying this object
+ auto xFloatWin = std::move(mpFloatWin);
+ maPopupModeEndHdl.Call(xFloatWin);
+ xFloatWin.disposeAndClear();
// call handler - which will destroy the window and thus the wrapper as well !
xWindow->CallEventListeners( VclEventId::WindowEndPopupMode, &aData );