Bug 864727 part 1. Root the global before calling WrapObject in XPCConvert. r=bholley

I sort of wish GetGlobalJSObject just returned a handle.
This commit is contained in:
Boris Zbarsky 2013-04-25 12:29:52 -04:00
parent 3f8a7bbc88
commit eb0cabfa76

View File

@ -840,8 +840,8 @@ XPCConvert::NativeInterface2JSObject(XPCLazyCallContext& lccx,
return false;
if (!flat) {
flat = cache->WrapObject(lccx.GetJSContext(),
xpcscope->GetGlobalJSObject());
JS::Rooted<JSObject*> global(cx, xpcscope->GetGlobalJSObject());
flat = cache->WrapObject(cx, global);
if (!flat)
return false;
}