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:
mcmullen@netscape.com
1999-03-27 00:09:04 +00:00
parent 591717eb8d
commit 8a93dbd094
2 changed files with 17 additions and 23 deletions

View File

@@ -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;
}