coverity#705963 Dereference before null check

Change-Id: I6371ef5e838d1e66ea9aeba75f554eea93426139
This commit is contained in:
Caolán McNamara
2014-02-21 13:30:53 +00:00
parent 0e0ac7cc65
commit 7a7ecf164a

View File

@@ -275,23 +275,20 @@ void UnoWrapper::WindowDestroyed( Window* pWindow )
// #i42462#/#116855# no, don't loop: Instead, just ensure that all our top-window-children
// are disposed, too (which should also be a valid fix for #102132#, but doesn't have the extreme
// performance penalties)
if ( pWindow )
Window* pTopWindowChild = pWindow->GetWindow( WINDOW_FIRSTTOPWINDOWCHILD );
while ( pTopWindowChild )
{
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!" );
Window* pNextTopChild = pTopWindowChild->GetWindow( WINDOW_NEXTTOPWINDOWSIBLING );
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();
//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;
}
pTopWindowChild = pNextTopChild;
}
}