mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Bug 730208 - Root JSD's pet global so it can't participate in CC cycles. r=billm
--HG-- extra : rebase_source : 9211b881e0c0931bd7df16989bed492449b1c74f
This commit is contained in:
parent
f7e9952e1d
commit
7cf2182f5e
@ -148,6 +148,9 @@ _newJSDContext(JSRuntime* jsrt,
|
||||
if( ! call )
|
||||
goto label_newJSDContext_failure;
|
||||
|
||||
if ( ! JS_AddNamedObjectRoot(jsdc->dumbContext, &jsdc->glob, "JSD context global") )
|
||||
goto label_newJSDContext_failure;
|
||||
|
||||
ok = JS_InitStandardClasses(jsdc->dumbContext, jsdc->glob);
|
||||
|
||||
JS_LeaveCrossCompartmentCall(call);
|
||||
@ -167,6 +170,8 @@ _newJSDContext(JSRuntime* jsrt,
|
||||
|
||||
label_newJSDContext_failure:
|
||||
if( jsdc ) {
|
||||
if ( jsdc->dumbContext && jsdc->glob )
|
||||
JS_RemoveObjectRoot(jsdc->dumbContext, &jsdc->glob);
|
||||
jsd_DestroyObjectManager(jsdc);
|
||||
jsd_DestroyAtomTable(jsdc);
|
||||
if( jsdc->dumbContext )
|
||||
@ -185,6 +190,8 @@ _destroyJSDContext(JSDContext* jsdc)
|
||||
JS_REMOVE_LINK(&jsdc->links);
|
||||
JSD_UNLOCK();
|
||||
|
||||
if ( jsdc->dumbContext && jsdc->glob )
|
||||
JS_RemoveObjectRoot(jsdc->dumbContext, &jsdc->glob);
|
||||
jsd_DestroyObjectManager(jsdc);
|
||||
jsd_DestroyAtomTable(jsdc);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user