diff options
author | Jens Stutte <jstutte@mozilla.com> | 2021-08-12 11:39:07 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2021-08-12 11:39:07 +0000 |
commit | fe2ea0ce886c6f7601d2eb27d508ecb9cb991e12 (patch) | |
tree | fe9fde44aeacfd1b81462d9ed3fee830c594c529 | |
parent | fa49002626ffa4894fc685536ae23251400481be (diff) | |
download | uxp-fe2ea0ce886c6f7601d2eb27d508ecb9cb991e12.tar.gz |
[DOM] Be more explicit about the WorkerPrivate self-reference.
-rw-r--r-- | dom/workers/WorkerPrivate.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index f33ded1c5f..5edf7dc4a5 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -4339,6 +4339,11 @@ WorkerPrivate::Constructor(JSContext* aCx, return nullptr; } + // From this point on (worker thread has been started) we + // must keep ourself alive. We can now only be cleared by + // ClearSelfAndParentEventTargetRef(). + worker->mSelfRef = worker; + worker->EnableDebugger(); RefPtr<CompileScriptRunnable> compiler = @@ -4348,8 +4353,6 @@ WorkerPrivate::Constructor(JSContext* aCx, return nullptr; } - worker->mSelfRef = worker; - return worker.forget(); } |