diff options
Diffstat (limited to 'toolkit/source/helper/unowrapper.cxx')
-rw-r--r-- | toolkit/source/helper/unowrapper.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx index fe41ad9a52ef..a652d493e653 100644 --- a/toolkit/source/helper/unowrapper.cxx +++ b/toolkit/source/helper/unowrapper.cxx @@ -292,11 +292,17 @@ void UnoWrapper::WindowDestroyed( Window* pWindow ) if ( pParent && pParent->GetWindowPeer() ) pParent->GetWindowPeer()->notifyWindowRemoved( *pWindow ); - if ( pWindow && pWindow->GetWindowPeer() ) + VCLXWindow* pWindowPeer = pWindow->GetWindowPeer(); + uno::Reference< lang::XComponent > xWindowPeerComp( pWindow->GetComponentInterface( FALSE ), uno::UNO_QUERY ); + OSL_ENSURE( ( pWindowPeer != NULL ) == ( xWindowPeerComp.is() == sal_True ), + "UnoWrapper::WindowDestroyed: inconsistency in the window's peers!" ); + if ( pWindowPeer ) { - pWindow->GetWindowPeer()->SetWindow( NULL ); + pWindowPeer->SetWindow( NULL ); pWindow->SetWindowPeer( NULL, NULL ); } + if ( xWindowPeerComp.is() ) + xWindowPeerComp->dispose(); // #102132# Iterate over frames after setting Window peer to NULL, // because while destroying other frames, we get get into the method again and try |