mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 1279618 - Don't touch the js::Class in JSObject::finalize() after having called the finalizer on it; r=jonco
This commit is contained in:
parent
6d673a6148
commit
1db86caf2d
@ -78,14 +78,15 @@ JSObject::finalize(js::FreeOp* fop)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
const js::Class* clasp = getClass();
|
const js::Class* clasp = getClass();
|
||||||
|
js::NativeObject* nobj = nullptr;
|
||||||
|
if (clasp->isNative())
|
||||||
|
nobj = &as<js::NativeObject>();
|
||||||
if (clasp->hasFinalize())
|
if (clasp->hasFinalize())
|
||||||
clasp->doFinalize(fop, this);
|
clasp->doFinalize(fop, this);
|
||||||
|
|
||||||
if (!clasp->isNative())
|
if (!nobj)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
js::NativeObject* nobj = &as<js::NativeObject>();
|
|
||||||
|
|
||||||
if (nobj->hasDynamicSlots())
|
if (nobj->hasDynamicSlots())
|
||||||
fop->free_(nobj->slots_);
|
fop->free_(nobj->slots_);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user