vcl/source/window/dockmgr.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
New commits: commit bbb3f36877807a5f6106956d7497f281169d9421 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Feb 26 12:04:50 2021 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Feb 26 20:57:04 2021 +0100 protect against callback destroying this object Change-Id: I4527f9bf5f2983083be8055dfb6277ed2dcd8c39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111626 Tested-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Caolán McNamara <caol...@redhat.com> 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 ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits