Changeset 63643 in vbox for trunk/src/VBox/Main/src-client/win
- Timestamp:
- Aug 25, 2016 5:19:22 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 110370
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/win/dllmain.cpp
r63641 r63643 117 117 } 118 118 119 120 #ifdef RT_OS_WINDOWS 121 /* 122 * HACK ALERT! Really ugly trick to make the VirtualBoxClient object go away 123 * when nobody uses it anymore. This is to prevent its uninit() 124 * method from accessing IVirtualBox and similar proxy stubs after 125 * COM has been officially shut down. 126 * 127 * It is simply TOO LATE to destroy the client object from DllMain/detach! 128 * 129 * This hack ASSUMES ObjectMap order. 130 * This hack is subject to a re-instantiation race. 131 */ 132 ULONG VirtualBoxClient::InternalRelease() 133 { 134 ULONG cRefs = VirtualBoxClientWrap::InternalRelease(); 135 # ifdef DEBUG_bird 136 char szMsg[64]; 137 RTStrPrintf(szMsg, sizeof(szMsg), "VirtualBoxClient: cRefs=%d\n", cRefs); 138 OutputDebugStringA(szMsg); 139 # endif 140 # if 1 /* enable ugly hack */ 141 if (cRefs == 1) 142 { 143 /* Make the factory to drop its reference. */ 144 if (ObjectMap[1].pCF) 145 { 146 InternalAddRef(); 147 148 CMyComClassFactorySingleton<VirtualBoxClient> *pFactory; 149 pFactory = dynamic_cast<CMyComClassFactorySingleton<VirtualBoxClient> *>(ObjectMap[1].pCF); 150 Assert(pFactory); 151 if (pFactory) 152 { 153 IUnknown *pUnknown = pFactory->m_spObj; 154 pFactory->m_spObj = NULL; 155 if (pUnknown) 156 pUnknown->Release(); 157 } 158 159 cRefs = VirtualBoxClientWrap::InternalRelease(); 160 } 161 } 162 # endif 163 return cRefs; 164 } 165 #endif 166 167
Note:
See TracChangeset
for help on using the changeset viewer.