Rearrange the code so that windows can be closed programmatically, and deregistration etc all happens, in a more foolproof way.
This commit is contained in:
@@ -255,14 +255,7 @@ nsAppShellService::CreateTopLevelWindow(nsIWebShellWindow *aParent,
|
||||
NS_IMETHODIMP
|
||||
nsAppShellService::CloseTopLevelWindow(nsIWebShellWindow* aWindow)
|
||||
{
|
||||
nsresult closerv, unregrv;
|
||||
|
||||
closerv = aWindow->Close();
|
||||
unregrv = UnregisterTopLevelWindow(aWindow);
|
||||
if (0 == mWindowList->Count())
|
||||
mAppShell->Exit();
|
||||
|
||||
return closerv == NS_OK ? unregrv : closerv;
|
||||
return aWindow->Close();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -331,6 +324,8 @@ nsAppShellService::UnregisterTopLevelWindow(nsIWebShellWindow* aWindow)
|
||||
mWindowList->RemoveElement(wsc);
|
||||
NS_RELEASE(wsc);
|
||||
}
|
||||
if (0 == mWindowList->Count())
|
||||
mAppShell->Exit();
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user