[Kde-windows] KDE/kdelibs/kdecore

Jaroslaw Staniek js at iidea.pl
Tue Oct 18 22:37:54 CEST 2005


SVN commit 471811 by staniek:

a fix for win32 (no support for __attribute__((destructor)) )

CCMAIL: kde-windows at kde.org



 M  +11 -0     kglobal.cpp  


--- trunk/KDE/kdelibs/kdecore/kglobal.cpp #471810:471811
@@ -208,7 +208,18 @@
 KCharsets       *KGlobal::_charsets	= 0;
 KStaticDeleterList *KGlobal::_staticDeleters = 0;
 
+#ifdef WIN32
+#include <windows.h>
+static void kglobal_freeAll();
+BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID impLoad )
+{
+    if (reason == DLL_PROCESS_DETACH)
+        kglobal_freeAll();
+    return TRUE;
+}
+#else
 __attribute__((destructor))
+#endif
 static void kglobal_freeAll()
 {
     delete KGlobal::_locale;



More information about the Kde-windows mailing list