summaryrefslogtreecommitdiff
path: root/toolkit/source/helper
diff options
context:
space:
mode:
authorMikhail Voytenko <mav@openoffice.org>2010-08-04 12:21:22 +0200
committerMikhail Voytenko <mav@openoffice.org>2010-08-04 12:21:22 +0200
commitc7821efc469f4bff0fd2a7ddfa922088111a0408 (patch)
treed515eaa6a116d91dc988c4ceb788f39108373a3b /toolkit/source/helper
parent9577038a0f0bebe7c69aedb451f358766ff844c2 (diff)
mib18: #163185# avoid crash when document is closed and a modal dialog is active
Diffstat (limited to 'toolkit/source/helper')
-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;
}
}
}