[browseui.cpp]

- Improve the hack for the global constructors by manually calling them only during DLL_PROCESS_ATTACH

svn path=/trunk/; revision=59543
This commit is contained in:
Giannis Adamopoulos 2013-07-20 17:50:40 +00:00
parent 8929ef31df
commit 38f41f733e

View file

@ -57,14 +57,14 @@ STDAPI_(BOOL) DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID fImpLoad)
{
TRACE("%p 0x%x %p\n", hInstance, dwReason, fImpLoad);
/* HACK - the global constructors don't run, so I placement new them here */
new (&gModule) CBrowseUIModule;
new (&gWinModule) CAtlWinModule;
new (&_AtlBaseModule) CAtlBaseModule;
new (&_AtlComModule) CAtlComModule;
if (dwReason == DLL_PROCESS_ATTACH)
{
/* HACK - the global constructors don't run, so I placement new them here */
new (&gModule) CBrowseUIModule;
new (&gWinModule) CAtlWinModule;
new (&_AtlBaseModule) CAtlBaseModule;
new (&_AtlComModule) CAtlComModule;
gModule.Init(ObjectMap, hInstance, NULL);
DisableThreadLibraryCalls (hInstance);
}