summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2023-10-25 18:04:26 +0200
committerMoonchild <moonchild@palemoon.org>2023-10-25 18:04:26 +0200
commit2c2ddd98d2923449b5998f3e1f829b6b524352ef (patch)
tree30096611925a012d53f5c5cab65e8afeac8b1ead
parentb15a36452d78004c3279159433bc515bf85feb8b (diff)
downloaduxp-2c2ddd98d2923449b5998f3e1f829b6b524352ef.tar.gz
[DOM] Drop mWrappedRunnable early in workers.
This should prevent some intermittent crashes.
-rw-r--r--dom/workers/WorkerPrivate.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp
index 51ab67f708..98f153ea89 100644
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -241,6 +241,7 @@ private:
WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate) override
{
nsresult rv = mWrappedRunnable->Run();
+ mWrappedRunnable = nullptr;
if (NS_FAILED(rv)) {
if (!JS_IsExceptionPending(aCx)) {
Throw(aCx, rv);
@@ -259,6 +260,7 @@ private:
MOZ_ASSERT(cancelable); // We checked this earlier!
rv = cancelable->Cancel();
nsresult rv2 = WorkerRunnable::Cancel();
+ mWrappedRunnable = nullptr;
return NS_FAILED(rv) ? rv : rv2;
}
};