summaryrefslogtreecommitdiff
path: root/toolkit/source/helper/unowrapper.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/source/helper/unowrapper.cxx')
-rw-r--r--toolkit/source/helper/unowrapper.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx
index d7cec7c17354..c36ae29d4531 100644
--- a/toolkit/source/helper/unowrapper.cxx
+++ b/toolkit/source/helper/unowrapper.cxx
@@ -318,12 +318,17 @@ void UnoWrapper::WindowDestroyed( Window* pWindow )
Window* pTopWindowChild = pWindow->GetWindow( WINDOW_FIRSTTOPWINDOWCHILD );
while ( pTopWindowChild )
{
- OSL_ENSURE( pTopWindowChild->GetParent() == pWindow, "UnoWrapper::WindowDestroyed: inconsistency in the SystemWindow relationship!" );
+ OSL_ENSURE( pTopWindowChild->GetParent() == pWindow,
+ "UnoWrapper::WindowDestroyed: inconsistency in the SystemWindow relationship!" );
- uno::Reference< lang::XComponent > xComp( pTopWindowChild->GetComponentInterface( FALSE ), uno::UNO_QUERY );
- pTopWindowChild = pTopWindowChild->GetWindow( WINDOW_NEXTTOPWINDOWSIBLING );
- if ( xComp.is() )
- xComp->dispose();
+ Window* pNextTopChild = pTopWindowChild->GetWindow( WINDOW_NEXTTOPWINDOWSIBLING );
+
+ //the window still could be on the stack, so we have to
+ // use lazy delete ( it will automatically
+ // disconnect from the currently destroyed parent window )
+ pTopWindowChild->doLazyDelete();
+
+ pTopWindowChild = pNextTopChild;
}
}
}