clean up use of nsAppShellService.UnregisterTopLevelWindow. bug 98792 r=alecf,ccarlen

git-svn-id: svn://10.0.0.236/trunk@102698 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
danm%netscape.com
2001-09-10 23:27:08 +00:00
parent f73c9721b9
commit 8a33dd4047
2 changed files with 20 additions and 4 deletions

View File

@@ -1260,8 +1260,16 @@ nsNativeAppSupportWin::HandleRequest( LPBYTE request, PRBool newWindow ) {
rv = appShell->GetNativeAppSupport( getter_AddRefs( native ));
if (NS_SUCCEEDED(rv)) {
native->SetIsServerMode( PR_FALSE );
// This closes app if there are no top-level windows.
appShell->UnregisterTopLevelWindow( 0 );
// close app if there are no more top-level windows.
PRBool quitIfNoWindows = PR_FALSE;
appShell->GetQuitOnLastWindowClosing( &quitIfNoWindows );
if (quitIfNoWindows) {
nsCOMPtr<nsIDOMWindowInternal> win;
GetMostRecentWindow( 0, getter_AddRefs( win ) );
if (!win)
appShell->Quit();
}
}
return;