Bug 887334 - Enter a compartment in b2g-only unloading code. r=me CLOSED TREE
authorBobby Holley <bobbyholley@gmail.com>
Wed, 17 Jul 2013 14:28:54 -0700
changeset 138927 ff75b1f352e912542ca6d768194fad6af6f32f10
parent 138926 3c1303aea1115f09db859e832d53003cb0ad50b4
child 138928 2d7edd0ded0e67405fe30e13bcd79abb498ec744
push id31172
push userbobbyholley@gmail.com
push dateWed, 17 Jul 2013 21:29:52 +0000
treeherdermozilla-inbound@ff75b1f352e9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs887334
milestone25.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 887334 - Enter a compartment in b2g-only unloading code. r=me CLOSED TREE
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;
     }