if ( mSupportingDDEExec && isDefaultBrowser() ) { mSupportingDDEExec = PR_FALSE; #if MOZ_DEBUG_DDE printf( "Deleting ddexec subkey on exit\n" ); #endif deleteKey( HKEY_CLASSES_ROOT, "http\\shell\\open\\ddeexec" ); }
nsNativeAppSupportWin::Quit() {    // If another process wants to look for the message window, they need    // to wait to hold the lock, in which case they will not find the    // window as we will destroy ours under our lock.    // When the mutex goes off the stack, it is unlocked via destructor.    Mutex mutexLock(mMutexName);    NS_ENSURE_TRUE(mutexLock.Lock(MOZ_DDE_START_TIMEOUT), NS_ERROR_FAILURE);    // If we've got a message window to receive IPC or new window requests,    // get rid of it as we are shutting down.    // Note:  Destroy calls DestroyWindow, which will only work on a window    //  created by the same thread.    MessageWindow mw;    mw.Destroy();    if ( mInstance ) {        // Undo registry setting if we need to.        if ( mSupportingDDEExec && isDefaultBrowser() ) {            mSupportingDDEExec = PR_FALSE;#if MOZ_DEBUG_DDE            printf( "Deleting ddexec subkey on exit\n" );#endif            deleteKey( HKEY_CLASSES_ROOT, "http\\shell\\open\\ddeexec" );        }        // Unregister application name.        DdeNameService( mInstance, mApplication, 0, DNS_UNREGISTER );        // Clean up strings.        if ( mApplication ) {            DdeFreeStringHandle( mInstance, mApplication );            mApplication = 0;        }        for ( int i = 0; i < topicCount; i++ ) {            if ( mTopics[i] ) {                DdeFreeStringHandle( mInstance, mTopics[i] );                mTopics[i] = 0;            }        }        DdeUninitialize( mInstance );        mInstance = 0;    }    return NS_OK;}