Bug 761135 - Remove XPCOMGlueShutdown. r=benjamin
authorBenoit Girard <b56girard@gmail.com>
Mon, 07 Jan 2013 16:19:39 -0500
changeset 118434 03fd5f43435d96f0b6dce09e2cec620ad3db633a
parent 118433 c3c55730918250b8551e727a30a7e3646f41cb7c
child 118435 9cda648d19fac9cba47833e2415106eba013049a
push id24166
push userMs2ger@gmail.com
push dateFri, 11 Jan 2013 13:57:41 +0000
treeherdermozilla-central@63c4b0f66a0c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbenjamin
bugs761135
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 761135 - Remove XPCOMGlueShutdown. r=benjamin
b2g/app/nsBrowserApp.cpp
browser/app/nsBrowserApp.cpp
mobile/xul/app/nsBrowserApp.cpp
xpcom/glue/standalone/nsXPCOMGlue.cpp
xpcom/glue/standalone/nsXPCOMGlue.h
xpcom/sample/program/nsTestSample.cpp
xulrunner/stub/nsXULStub.cpp
--- a/b2g/app/nsBrowserApp.cpp
+++ b/b2g/app/nsBrowserApp.cpp
@@ -244,11 +244,10 @@ int main(int argc, char* argv[])
   }
 
   int result;
   {
     ScopedLogging log;
     result = do_main(argc, argv);
   }
 
-  XPCOMGlueShutdown();
   return result;
 }
--- a/browser/app/nsBrowserApp.cpp
+++ b/browser/app/nsBrowserApp.cpp
@@ -383,25 +383,19 @@ int main(int argc, char* argv[])
   }
 
   int result;
   {
     ScopedLogging log;
     result = do_main(argc, argv, xreDirectory);
   }
 
-  XPCOMGlueShutdown();
-
-
 #ifdef XP_MACOSX
   // Allow writes again. While we would like to catch writes from static
   // destructors to allow early exits to use _exit, we know that there is
   // at least one such write that we don't control (see bug 826029). For
   // now we enable writes again and early exits will have to use exit instead
   // of _exit.
-
-  // Currently write poisoning is only available on OS X. Since on OS X we never
-  // unload XUL, it is safe to call this function after XPCOMGlueShutdown.
   XRE_DisableWritePoisoning();
 #endif
 
   return result;
 }
--- a/mobile/xul/app/nsBrowserApp.cpp
+++ b/mobile/xul/app/nsBrowserApp.cpp
@@ -255,11 +255,10 @@ int main(int argc, char* argv[])
   }
 
   int result;
   {
     ScopedLogging log;
     result = do_main(argc, argv);
   }
 
-  XPCOMGlueShutdown();
   return result;
 }
--- a/xpcom/glue/standalone/nsXPCOMGlue.cpp
+++ b/xpcom/glue/standalone/nsXPCOMGlue.cpp
@@ -104,25 +104,16 @@ XPCOMGlueLoadDependentLibs(const char *x
                  "%s" XPCOM_FILE_PATH_SEPARATOR "%s",
                  xpcomDir, buffer);
         cb(buffer2, do_preload);
     }
 
     fclose(flist);
 }
 
-extern "C"
-nsresult XPCOMGlueShutdown()
-{
-    XPCOMGlueUnload();
-    
-    memset(&xpcomFunctions, 0, sizeof(xpcomFunctions));
-    return NS_OK;
-}
-
 XPCOM_API(nsresult)
 NS_InitXPCOM2(nsIServiceManager* *result, 
               nsIFile* binDirectory,
               nsIDirectoryServiceProvider* appFileLocationProvider)
 {
     if (!xpcomFunctions.init)
         return NS_ERROR_NOT_INITIALIZED;
     return xpcomFunctions.init(result, binDirectory, appFileLocationProvider);
--- a/xpcom/glue/standalone/nsXPCOMGlue.h
+++ b/xpcom/glue/standalone/nsXPCOMGlue.h
@@ -41,16 +41,10 @@ struct nsDynamicFunctionLoad
  * @throws NS_ERROR_NOT_INITIALIZED if XPCOMGlueStartup() was not called or
  *         if the libxul DLL was not found.
  * @throws NS_ERROR_LOSS_OF_SIGNIFICANT_DATA if only some of the required
  *         functions were found.
  */
 extern "C" NS_HIDDEN_(nsresult)
 XPCOMGlueLoadXULFunctions(const nsDynamicFunctionLoad *symbols);
 
-/**
- * Finish the XPCOM glue after it is no longer needed.
- */
-extern "C" NS_HIDDEN_(nsresult)
-XPCOMGlueShutdown();
-
 #endif // XPCOM_GLUE
 #endif // nsXPCOMGlue_h__
--- a/xpcom/sample/program/nsTestSample.cpp
+++ b/xpcom/sample/program/nsTestSample.cpp
@@ -100,11 +100,10 @@ main(void)
     // as we should not hold references passed XPCOM Shutdown.
     servMan = 0;
     manager = 0;
     mysample = 0;
     
     // Shutdown XPCOM
     NS_ShutdownXPCOM(nullptr);
 
-    XPCOMGlueShutdown();
     return 0;
 }
--- a/xulrunner/stub/nsXULStub.cpp
+++ b/xulrunner/stub/nsXULStub.cpp
@@ -480,12 +480,10 @@ main(int argc, char **argv)
 #endif
     }
 
     retval = XRE_main(argc, argv, appData, 0);
   }
 
   NS_LogTerm();
 
-  XPCOMGlueShutdown();
-
   return retval;
 }