Backed out changeset 689690a17de3 (bug 833143) since the attempt at merging the backout from m-c was lost.
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 24 Jan 2013 16:35:31 -0500
changeset 119798 ea8af024e14d05b01b0fcb8e48da0301e9007b22
parent 119797 d0b6aff973580a91216c75616e7b3d77403e9e29
child 119799 a7115ec2354f986fc44df4a22bad9a264430e0a1
push id24224
push userryanvm@gmail.com
push dateFri, 25 Jan 2013 01:59:34 +0000
treeherdermozilla-central@82f3c39bc8fc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs833143
milestone21.0a1
backs out689690a17de325806197886e7a0d578aca2c1314
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
Backed out changeset 689690a17de3 (bug 833143) since the attempt at merging the backout from m-c was lost.
toolkit/xre/nsXREDirProvider.cpp
--- a/toolkit/xre/nsXREDirProvider.cpp
+++ b/toolkit/xre/nsXREDirProvider.cpp
@@ -842,16 +842,29 @@ nsXREDirProvider::DoShutdown()
       mozilla::services::GetObserverService();
     NS_ASSERTION(obsSvc, "No observer service?");
     if (obsSvc) {
       static const PRUnichar kShutdownPersist[] =
         {'s','h','u','t','d','o','w','n','-','p','e','r','s','i','s','t','\0'};
       obsSvc->NotifyObservers(nullptr, "profile-change-net-teardown", kShutdownPersist);
       obsSvc->NotifyObservers(nullptr, "profile-change-teardown", kShutdownPersist);
 
+      // Phase 2c: Now that things are torn down, force JS GC so that things which depend on
+      // resources which are about to go away in "profile-before-change" are destroyed first.
+
+      nsCOMPtr<nsIJSRuntimeService> rtsvc
+        (do_GetService("@mozilla.org/js/xpc/RuntimeService;1"));
+      if (rtsvc)
+      {
+        JSRuntime *rt = nullptr;
+        rtsvc->GetRuntime(&rt);
+        if (rt)
+          ::JS_GC(rt);
+      }
+
       // Phase 3: Notify observers of a profile change
       obsSvc->NotifyObservers(nullptr, "profile-before-change", kShutdownPersist);
     }
     mProfileNotified = false;
   }
 }
 
 #ifdef XP_WIN