[browseui.cpp]
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Sat, 20 Jul 2013 17:50:40 +0000 (17:50 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Sat, 20 Jul 2013 17:50:40 +0000 (17:50 +0000)
- Improve the hack for the global constructors by manually calling them only during DLL_PROCESS_ATTACH

svn path=/trunk/; revision=59543

reactos/dll/win32/browseui/browseui.cpp

index e877116..5c3aeeb 100644 (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);
     }