Changeset 63639 in vbox
- Timestamp:
- Aug 25, 2016 2:31:10 PM (8 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
-
include/VirtualBoxClientImpl.h (modified) (2 diffs)
-
src-client/VirtualBoxClientImpl.cpp (modified) (2 diffs)
-
src-client/win/dllmain.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/VirtualBoxClientImpl.h
r62258 r63639 66 66 struct Data 67 67 { 68 Data() 68 Data() : m_ThreadWatcher(NIL_RTTHREAD), m_SemEvWatcher(NIL_RTSEMEVENT) 69 69 {} 70 71 ~Data() 72 { 73 /* HACK ALERT! This is for DllCanUnloadNow(). */ 74 if (m_pEventSource.isNotNull()) 75 { 76 s_cUnnecessaryAtlModuleLocks--; 77 AssertMsg(s_cUnnecessaryAtlModuleLocks == 0, ("%d\n", s_cUnnecessaryAtlModuleLocks)); 78 } 79 } 70 80 71 81 ComPtr<IVirtualBox> m_pVirtualBox; … … 77 87 78 88 Data mData; 89 90 public: 91 /** Hack for discounting the AtlModule lock held by Data::m_pEventSource during 92 * DllCanUnloadNow(). This is incremented to 1 when init() initialized 93 * m_pEventSource and is decremented by the Data destructor (above). */ 94 static LONG s_cUnnecessaryAtlModuleLocks; 79 95 }; 80 96 81 #endif // ____H_VIRTUALBOXCLIENTIMPL97 #endif 82 98 /* vi: set tabstop=4 shiftwidth=4 expandtab: */ -
trunk/src/VBox/Main/src-client/VirtualBoxClientImpl.cpp
r61117 r63639 37 37 uint32_t VirtualBoxClient::g_cInstances = 0; 38 38 39 LONG VirtualBoxClient::s_cUnnecessaryAtlModuleLocks = 0; 39 40 40 41 // constructor / destructor … … 104 105 AssertComRCThrow(rc, setError(rc, 105 106 tr("Could not initialize EventSource for VirtualBoxClient"))); 107 108 /* HACK ALERT! This is for DllCanUnloadNow(). */ 109 s_cUnnecessaryAtlModuleLocks++; 110 AssertMsg(s_cUnnecessaryAtlModuleLocks == 1, ("%d\n", s_cUnnecessaryAtlModuleLocks)); 106 111 107 112 /* Setting up the VBoxSVC watcher thread. If anything goes wrong here it -
trunk/src/VBox/Main/src-client/win/dllmain.cpp
r60865 r63639 75 75 { 76 76 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; 78 80 } 79 81 … … 83 85 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) 84 86 { 87 HRESULT hrc; 85 88 AssertReturn(g_pAtlComModule, E_UNEXPECTED); 86 89 return g_pAtlComModule->GetClassObject(rclsid, riid, ppv);
Note:
See TracChangeset
for help on using the changeset viewer.

