VirtualBox

Ignore:
Timestamp:
Nov 22, 2017 11:42:14 AM (7 years ago)
Author:
vboxsync
Message:

svcmain.cpp: Only call IVirtualBoxSDS::deregisterVBoxSVC from the chosen VBoxSVC. Avoid calling it during com shutdown (just to be on the safe side).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/win/svcmain.cpp

    r69783 r69803  
    7979HINSTANCE   g_hInstance   = NULL;
    8080#ifdef VBOX_WITH_SDS
    81 /** This is set if we're connected to SDS and should discount a server lock
    82  * that it is holding when deciding whether we're idle or not. */
     81/** This is set if we're connected to SDS.
     82 *
     83 * It means that we should discount a server lock that it is holding when
     84 * deciding whether we're idle or not.
     85 *
     86 * Also, when set we deregister with SDS during class factory destruction.  We
     87 * exploit this to prevent attempts to deregister during or after COM shutdown.
     88 */
    8389bool        g_fRegisteredWithVBoxSDS = false;
    8490#endif
     
    220226        }
    221227
    222         /** @todo Need to check if this is okay wrt COM termination. */
    223         i_deregisterWithSds();
     228        /* We usually get here during g_pModule->Term() via CoRevokeClassObjec, so COM
     229           probably working well enough to talk to SDS when we get here. */
     230        if (g_fRegisteredWithVBoxSDS)
     231            i_deregisterWithSds();
    224232    }
    225233
     
    323331        if (SUCCEEDED(hrc))
    324332        {
    325             g_fRegisteredWithVBoxSDS = true;
     333            g_fRegisteredWithVBoxSDS = !*ppOtherVirtualBox;
    326334            return hrc;
    327335        }
     
    901909    g_pModule->Term();
    902910
     911#ifdef VBOX_WITH_SDS
     912    g_fRegisteredWithVBoxSDS = false; /* Don't trust COM LPC to work right from now on.  */
     913#endif
    903914    com::Shutdown();
    904915
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette