mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-03 14:28:39 +09:00
Issue #1990 - Part 6 - Fix for infinite loop from Release() on shutdown worker. If the worker is shut down, call Cancel() on the Runnable, this will prevent nsInputStreamReadyEvents to be called again when deallocated.
This commit is contained in:
parent
5fd53649bd
commit
b14a145be6
1 changed files with 7 additions and 0 deletions
|
|
@ -1930,6 +1930,13 @@ EventSourceImpl::Dispatch(already_AddRefed<nsIRunnable> aEvent, uint32_t aFlags)
|
|||
}
|
||||
|
||||
if (IsShutDown()) {
|
||||
// If the worker is shut down, we don't want to leave this event hanging.
|
||||
// If it is a cancelable we should call Cancel() to make sure it stops.
|
||||
// That way we can safely return NS_OK to prevent shutdown error messages.
|
||||
nsCOMPtr<nsICancelableRunnable> cancelable = do_QueryInterface(event_ref);
|
||||
if (cancelable) {
|
||||
cancelable->Cancel();
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
MOZ_ASSERT(mWorkerPrivate);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue