From c0ab25726daf60ded65903d54b8cccaf0cb46661 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Fri, 6 Dec 2019 17:03:06 +0100 Subject: Add missing call to WaitForIsDebuggerRegistered --- dom/workers/WorkerPrivate.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index 27eb570e9..c6ef21f2c 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -2543,6 +2543,12 @@ WorkerPrivateParent::DisableDebugger() WorkerPrivate* self = ParentAsWorkerPrivate(); + // RegisterDebugger might have been dispatched but not completed. + // Wait for its execution to complete before unregistering. + if (!NS_IsMainThread()) { + self->WaitForIsDebuggerRegistered(true); + } + if (NS_FAILED(UnregisterWorkerDebugger(self))) { NS_WARNING("Failed to unregister worker debugger!"); } -- cgit v1.2.3