mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 819443 - Make sure we don't finalize on background thread (r=luke)
This commit is contained in:
parent
17f16ce86d
commit
bd1e47165c
@ -482,7 +482,11 @@ struct JSRuntime : js::RuntimeFriendFields
|
||||
void clearOwnerThread();
|
||||
void setOwnerThread();
|
||||
JS_FRIEND_API(void) abortIfWrongThread() const;
|
||||
#ifdef DEBUG
|
||||
JS_FRIEND_API(void) assertValidThread() const;
|
||||
#else
|
||||
void assertValidThread() const {}
|
||||
#endif
|
||||
private:
|
||||
void *ownerThread_;
|
||||
public:
|
||||
|
@ -225,6 +225,9 @@ JSObject::finalize(js::FreeOp *fop)
|
||||
js::Probes::finalizeObject(this);
|
||||
|
||||
if (!IsBackgroundFinalized(getAllocKind())) {
|
||||
/* Assert we're on the main thread. */
|
||||
fop->runtime()->assertValidThread();
|
||||
|
||||
/*
|
||||
* Finalize obj first, in case it needs map and slots. Objects with
|
||||
* finalize hooks are not finalized in the background, as the class is
|
||||
|
Loading…
Reference in New Issue
Block a user