mDeleteCalled = PR_TRUE; nsCOMPtr<nsIWebShellWindow> hiddenWin(do_QueryInterface(mHiddenWindow)); if(hiddenWin) { ClearXPConnectSafeContext(); hiddenWin->Close(); }
NS_IF_RELEASE(mAppShell); NS_IF_RELEASE(mWindowList); NS_IF_RELEASE(mCmdLineService); if (mHiddenWindow) mHiddenWindow->Close(); if (mWindowMediator) nsServiceManager::ReleaseService(kWindowMediatorCID, mWindowMediator);
nsAppShellService::~nsAppShellService(){  mDeleteCalled = PR_TRUE;  nsCOMPtr<nsIWebShellWindow> hiddenWin(do_QueryInterface(mHiddenWindow));  if(hiddenWin) {    ClearXPConnectSafeContext();    hiddenWin->Close();  }  /* Note we don't unregister with the observer service     (RegisterObserver(PR_FALSE)) because, being refcounted, we can't have     reached our own destructor until after the ObserverService has shut down     and released us. This means we leak until the end of the application, but     so what; this is the appshell service. */}