mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1747941: Don't assert in CleanUp if we failed to get a WorkerRef r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D135006
This commit is contained in:
parent
17025d2d80
commit
a9a672ddeb
@ -698,7 +698,8 @@ already_AddRefed<PromiseWorkerProxy> PromiseWorkerProxy::Create(
|
||||
|
||||
if (NS_WARN_IF(!workerRef)) {
|
||||
// Probably the worker is terminating. We cannot complete the operation
|
||||
// and we have to release all the resources.
|
||||
// and we have to release all the resources. CleanUp releases the extra
|
||||
// ref, too
|
||||
proxy->CleanUp();
|
||||
return nullptr;
|
||||
}
|
||||
@ -787,8 +788,10 @@ void PromiseWorkerProxy::CleanUp() {
|
||||
return;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(mWorkerRef);
|
||||
mWorkerRef->Private()->AssertIsOnWorkerThread();
|
||||
// We can be called if we failed to get a WorkerRef
|
||||
if (mWorkerRef) {
|
||||
mWorkerRef->Private()->AssertIsOnWorkerThread();
|
||||
}
|
||||
|
||||
// Release the Promise and remove the PromiseWorkerProxy from the holders of
|
||||
// the worker thread since the Promise has been resolved/rejected or the
|
||||
|
Loading…
Reference in New Issue
Block a user