Add missing call to WaitForIsDebuggerRegistered.

master
Fedor 2019-12-25 15:48:00 +03:00
parent 6ba30e77c9
commit c0ef38d1d3
1 changed files with 6 additions and 0 deletions

View File

@ -2543,6 +2543,12 @@ WorkerPrivateParent<Derived>::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!");
}