nsCOMPtr<nsIAppStartup> appShell
nsCOMPtr<nsIAppStartup> appStartup
nsNativeAppSupportOS2::OnLastWindowClosing() {     if ( !mServerMode )        return NS_OK;    // If the last window closed is our special "turbo" window made    // in StartServerMode(), don't do anything.    if ( mInitialWindowActive ) {        mInitialWindowActive = PR_FALSE;        return NS_OK;    }    nsresult rv;    // If activated by the browser.turbo.singleProfileOnly pref,    // check for multi-profile situation and turn off turbo mode    // if there are multiple profiles.    PRBool singleProfileOnly = PR_FALSE;    nsCOMPtr<nsIPref> prefService( do_GetService( NS_PREF_CONTRACTID, &rv ) );    if ( NS_SUCCEEDED( rv ) ) {        prefService->GetBoolPref( "browser.turbo.singleProfileOnly", &singleProfileOnly );    }    if ( singleProfileOnly ) {        nsCOMPtr<nsIProfile> profileMgr( do_GetService( NS_PROFILE_CONTRACTID, &rv ) );        if ( NS_SUCCEEDED( rv ) ) {            PRInt32 profileCount = 0;            if ( NS_SUCCEEDED( profileMgr->GetProfileCount( &profileCount ) ) &&                 profileCount > 1 ) {                // Turn off turbo mode and quit the application.                SetIsServerMode( PR_FALSE );                nsCOMPtr<nsIAppStartup> appShell                    (do_GetService(NS_APPSTARTUP_CONTRACTID, &rv));                if ( NS_SUCCEEDED( rv ) ) {                    appShell->Quit(nsIAppShellService::eAttemptQuit);                }                return NS_OK;            }        }    }    nsCOMPtr<nsIObserverService> observerService(do_GetService("@mozilla.org/observer-service;1", &rv));    if (NS_FAILED(rv)) return rv;    observerService->NotifyObservers(nsnull, "session-logout", nsnull);    mForceProfileStartup = PR_TRUE;    return NS_OK;}