Ensure that JSOPTION_UNROOTED_GLOBAL is set when we cycle collect (stop-gap measure for bug 584495, r=brendan).

This commit is contained in:
Andreas Gal 2010-08-06 20:24:49 -07:00
parent 9f5d2e6532
commit ea8ed0fbf0

View File

@ -498,6 +498,15 @@ JSBool XPCJSRuntime::GCCallback(JSContext *cx, JSGCStatus status)
{
return JS_FALSE;
}
// We seem to sometime lose the unrooted global flag. Restore it
// here. FIXME: bug 584495.
JSContext *iter = nsnull, *acx;
while((acx = JS_ContextIterator(cx->runtime, &iter))) {
if (!JS_HAS_OPTION(acx, JSOPTION_UNROOTED_GLOBAL))
JS_ToggleOptions(acx, JSOPTION_UNROOTED_GLOBAL);
}
break;
}
case JSGC_MARK_END: