Bug 887334 - (followup) - Enter a compartment in b2g-only unloading code. r=me
authorBobby Holley <bobbyholley@gmail.com>
Wed, 31 Jul 2013 10:59:31 -0700
changeset 148190 1662a10d65d0e99f7e1c3c319381d4c85ad8f245
parent 148189 69899b42092d8eadedc32eb17e3caa5b1a2ecee0
child 148191 8d21aed06d49618cad34a80e7620c54aec486e5e
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs887334
milestone24.0a2
Bug 887334 - (followup) - Enter a compartment in b2g-only unloading code. r=me
js/xpconnect/loader/mozJSComponentLoader.cpp
--- a/js/xpconnect/loader/mozJSComponentLoader.cpp
+++ b/js/xpconnect/loader/mozJSComponentLoader.cpp
@@ -1070,16 +1070,17 @@ mozJSComponentLoader::UnloadModules()
     mInitialized = false;
 
     if (mLoaderGlobal) {
         MOZ_ASSERT(mReuseLoaderGlobal, "How did this happen?");
 
         JSAutoRequest ar(mContext);
         RootedObject global(mContext, mLoaderGlobal->GetJSObject());
         if (global) {
+            JSAutoCompartment ac(mContext, global);
             JS_SetAllNonReservedSlotsToUndefined(mContext, global);
         } else {
             NS_WARNING("Going to leak!");
         }
 
         mLoaderGlobal = nullptr;
     }