[Amizilla-cvs] amizilla/xpcom/build nsXPComInit.cpp,1.1.1.2,1.2
Brought to you by:
maxlarsson
From: Jeff S. <jsh...@us...> - 2004-10-11 21:08:12
|
Update of /cvsroot/amizilla/amizilla/xpcom/build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32488 Modified Files: nsXPComInit.cpp Log Message: AmigaOS defines I need to do some tricks so that XPCOm cleans up correctly when the library is being unloaded. Index: nsXPComInit.cpp =================================================================== RCS file: /cvsroot/amizilla/amizilla/xpcom/build/nsXPComInit.cpp,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -C2 -d -r1.1.1.2 -r1.2 *** nsXPComInit.cpp 29 Jun 2004 10:42:01 -0000 1.1.1.2 --- nsXPComInit.cpp 11 Oct 2004 21:07:50 -0000 1.2 *************** *** 113,116 **** --- 113,121 ---- #include "SpecialSystemDirectory.h" + #ifdef XP_AMIGAOS + #include "nspr.h" + #include "nspr4.h" + #endif + // Registry Factory creation function defined in nsRegistry.cpp // We hook into this function locally to create and register the registry *************** *** 272,275 **** --- 277,296 ---- static PRBool gXPCOMHasGlobalsBeenInitalized = PR_TRUE; + #ifdef XP_AMIGAOS + extern "C" { + extern void _MD_Exit(void); + } + static void NS_COM closeXPCOM(void) { + + if (gXPCOMHasGlobalsBeenInitalized) { + NS_ShutdownXPCOM(nsnull); + } + // I need to call the MD_Exit function in nspr as to call to clean up the + // xpcom thread privates since xpcom gets cleaned up (and deleted) + // before nspr + _MD_Exit(); + } + #endif + // For each class that wishes to support nsIClassInfo, add a line like this // NS_DECL_CLASSINFO(nsMyClass) *************** *** 632,636 **** nsnull, NS_XPCOM_STARTUP_OBSERVER_ID); ! return NS_OK; } --- 653,660 ---- nsnull, NS_XPCOM_STARTUP_OBSERVER_ID); ! ! #ifdef XP_AMIGAOS ! atexit(closeXPCOM); ! #endif return NS_OK; } |