diff --git a/js/xpconnect/loader/mozJSComponentLoader.cpp b/js/xpconnect/loader/mozJSComponentLoader.cpp index 09b30a4588d3..06e3a3048eca 100644 --- a/js/xpconnect/loader/mozJSComponentLoader.cpp +++ b/js/xpconnect/loader/mozJSComponentLoader.cpp @@ -1075,6 +1075,7 @@ mozJSComponentLoader::UnloadModules() JSAutoRequest ar(mContext); RootedObject global(mContext, mLoaderGlobal->GetJSObject()); if (global) { + JSAutoCompartment ac(mContext, global); JS_SetAllNonReservedSlotsToUndefined(mContext, global); } else { NS_WARNING("Going to leak!");