summaryrefslogtreecommitdiff
path: root/vcl/source/window/window.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-05-19 15:24:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-19 19:20:32 +0200
commit6989c3df0facf3a5cb373942c337cbc7879fc0db (patch)
tree59545a7bf5cbc0f06fe38e183c865588a08e8cce /vcl/source/window/window.cxx
parent3f72d4d68817210ef6852e83d6d4bbdb540cea18 (diff)
fix crash in X-Ray extension
caused by commit 883b7a34d288410ac6f820e91d9eaa65ba2b9cb1 DBG_ASSERT->assert in UnoWrapper No idea why X-ray is triggering this, but it seems to work when I dial it back to a SAL_WARN again And also caused by commit 5aa60be574ece81b27c8f63e6e809871c694dba0 fix leak in VCLXWindow So disconnect the toolkit-window-peer from the vcl::Window before disposing the peer. Change-Id: I3310b76c1affc13c53c1e23810e383a8d2152ec7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115806 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/window/window.cxx')
-rw-r--r--vcl/source/window/window.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 0a279983d02d..fa3cb12133d5 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -3129,6 +3129,11 @@ void Window::SetWindowPeer( Reference< css::awt::XWindowPeer > const & xPeer, VC
// be safe against re-entrance: first clear the old ref, then assign the new one
if (mpWindowImpl->mxWindowPeer)
{
+ // first, disconnect the peer from ourself, otherwise disposing it, will dispose us
+ UnoWrapperBase* pWrapper = UnoWrapperBase::GetUnoWrapper();
+ SAL_WARN_IF( !pWrapper, "vcl.window", "SetComponentInterface: No Wrapper!" );
+ if ( pWrapper )
+ pWrapper->SetWindowInterface( nullptr, mpWindowImpl->mxWindowPeer );
mpWindowImpl->mxWindowPeer->dispose();
mpWindowImpl->mxWindowPeer.clear();
}