VirtualBox

Ignore:
Timestamp:
Aug 25, 2016 2:31:10 PM (8 years ago)
Author:
vboxsync
Message:

VBoxC: Looks like VirtualBoxClient::Data::m_pEventSource is holding in extra reference on the ATL module, causing VBoxC to be unloaded too late because DllCanUnloadNow() returns S_FALSE due to GetLockCount() being 1 instead of 0. Created a hack for discounting the module lock held by the EventSource in the VirtualBoxClient singelton.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/win/dllmain.cpp

    r60865 r63639  
    7575{
    7676    AssertReturn(g_pAtlComModule, S_OK);
    77     return g_pAtlComModule->GetLockCount() == 0 ? S_OK : S_FALSE;
     77    LONG const cLocks = g_pAtlComModule->GetLockCount();
     78    Assert(cLocks >= VirtualBoxClient::s_cUnnecessaryAtlModuleLocks);
     79    return cLocks <= VirtualBoxClient::s_cUnnecessaryAtlModuleLocks ? S_OK : S_FALSE;
    7880}
    7981
     
    8385STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
    8486{
     87    HRESULT hrc;
    8588    AssertReturn(g_pAtlComModule, E_UNEXPECTED);
    8689    return g_pAtlComModule->GetClassObject(rclsid, riid, ppv);
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