VirtualBox

Ignore:
Timestamp:
May 6, 2016 2:43:04 PM (9 years ago)
Author:
vboxsync
Message:

Never use static instances of CComModule as it messes up the log filename by using VBoxRT.dll before it's initialized.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r60862 r60865  
    180180////////////////////////////////////////////////////////////////////////////////
    181181
    182 #ifdef VBOX_WS_WIN
    183 /** ATL requires a module to be instantiated (set internal global variable).
    184  * @note Do NOT do this statically as it starts using IPRT before it's ready! */
    185 static ATL::CComModule *_Module;
    186 #endif
    187182
    188183/* static */
     
    203198    /* Create instance: */
    204199    new VBoxGlobal;
    205 #ifdef VBOX_WS_WIN
    206     _Module = new ATL::CComModule;
    207 #endif
    208200    /* Prepare instance: */
    209201    m_spInstance->prepare();
  • trunk/src/VBox/Frontends/VirtualBox/src/main.cpp

    r60362 r60865  
    362362extern "C" DECLEXPORT(int) TrustedMain(int argc, char **argv, char ** /*envp*/)
    363363{
     364#ifdef RT_OS_WINDOWS
     365    ATL::CComModule _Module; /* Required internally by ATL (constructor records instance in global variable). */
     366#endif
     367
    364368    /* Failed result initially: */
    365369    int iResultCode = 1;
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