Bug 927939 - Wrappers for nursery allocated objects should be finalized in the background r=terrence

This commit is contained in:
Jon Coppeard 2013-11-05 10:15:33 +00:00
parent 80ebb51518
commit 3219a5619c

View File

@ -181,9 +181,12 @@ bool Wrapper::finalizeInBackground(Value priv)
/*
* Make the 'background-finalized-ness' of the wrapper the same as the
* wrapped object, to allow transplanting between them.
*
* If the wrapped object is in the nursery then we know it doesn't have a
* finalizer, and so background finalization is ok.
*/
if (IsInsideNursery(priv.toObject().runtimeFromMainThread(), &priv.toObject()))
return false;
return true;
return IsBackgroundFinalized(priv.toObject().tenuredGetAllocKind());
}