mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +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
|
||||
|
||||
const js::Class* clasp = getClass();
|
||||
js::NativeObject* nobj = nullptr;
|
||||
if (clasp->isNative())
|
||||
nobj = &as<js::NativeObject>();
|
||||
if (clasp->hasFinalize())
|
||||
clasp->doFinalize(fop, this);
|
||||
|
||||
if (!clasp->isNative())
|
||||
if (!nobj)
|
||||
return;
|
||||
|
||||
js::NativeObject* nobj = &as<js::NativeObject>();
|
||||
|
||||
if (nobj->hasDynamicSlots())
|
||||
fop->free_(nobj->slots_);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user