Bug 883657 - Part 1: Run mozJSComponentLoader::UnloadModules() before the shutdown CC. r=bsmedberg, a=bajaj
authorAndrew McCreight <amccreight@mozilla.com>
Tue, 25 Jun 2013 08:42:39 -0700
changeset 148426 a4ae95d3793835bd9e32b9ff95ba63fea77c8f75
parent 148425 3e6f26fe39b48da54f5f5d221c4737f7ae3591eb
child 148427 6325125d05b3d5686fe9833436d5400358d14f37
push id2798
push userryanvm@gmail.com
push dateFri, 23 Aug 2013 18:33:53 +0000
treeherdermozilla-beta@743c2e397417 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg, bajaj
bugs883657
milestone24.0
Bug 883657 - Part 1: Run mozJSComponentLoader::UnloadModules() before the shutdown CC. r=bsmedberg, a=bajaj
xpcom/build/nsXPComInit.cpp
--- a/xpcom/build/nsXPComInit.cpp
+++ b/xpcom/build/nsXPComInit.cpp
@@ -643,18 +643,16 @@ ShutdownXPCOM(nsIServiceManager* servMgr
     // Shutdown global servicemanager
     if (nsComponentManagerImpl::gComponentManager) {
         nsComponentManagerImpl::gComponentManager->FreeServices();
     }
 
     // Release the directory service
     NS_IF_RELEASE(nsDirectoryService::gService);
 
-    nsCycleCollector_shutdown();
-
     if (moduleLoaders) {
         bool more;
         nsCOMPtr<nsISupports> el;
         while (NS_SUCCEEDED(moduleLoaders->HasMoreElements(&more)) &&
                more) {
             moduleLoaders->GetNext(getter_AddRefs(el));
 
             // Don't worry about weak-reference observers here: there is
@@ -670,16 +668,18 @@ ShutdownXPCOM(nsIServiceManager* servMgr
                 (void) obs->Observe(nullptr,
                                     NS_XPCOM_SHUTDOWN_LOADERS_OBSERVER_ID,
                                     nullptr);
         }
 
         moduleLoaders = nullptr;
     }
 
+    nsCycleCollector_shutdown();
+
     PROFILER_MARKER("Shutdown xpcom");
     // If we are doing any shutdown checks, poison writes.
     if (gShutdownChecks != SCM_NOTHING) {
         mozilla::PoisonWrite();
     }
 
     // Shutdown nsLocalFile string conversion
     NS_ShutdownLocalFile();