Update of /cvsroot/mahogany/M/src/classes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8554/src/classes

Modified Files:
        MModule.cpp 
Log Message:
added MMODULE_CLEANUP to make it possible to call a function on module unload

Index: MModule.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/classes/MModule.cpp,v
retrieving revision 1.92
retrieving revision 1.93
diff -b -u -2 -r1.92 -r1.93
--- MModule.cpp 11 Jul 2004 22:35:55 -0000      1.92
+++ MModule.cpp 2 Dec 2004 08:04:44 -0000       1.93
@@ -144,9 +144,17 @@
 
 #ifndef USE_MODULES_STATIC
+   wxDynamicLibrary *dll = module->GetDLL();
+
+   // call cleanup function, if any
+   MModule_CleanUpFuncType funcCleanup =
+      (MModule_CleanUpFuncType)dll->GetSymbol(MMODULE_CLEANUP_FUNCTION);
+   if ( funcCleanup )
+      (*funcCleanup)();
+
    // we can't unload the DLL right now because we're still executing in the
    // modules dtor which is in this DLL (and so doing it would result in
    // immediate crash) -- instead put it in the list of the DLLs to unload
    // which will be processed in wxMApp::OnIdle()
-   m_dllsToUnload.push_back(module->GetDLL());
+   m_dllsToUnload.push_back(dll);
 #endif // USE_MODULES_STATIC
 



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to