зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1870423
- Take always ownership of aRunnable in RemoteLazyInputStreamThread::Dispatch. r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D196765
This commit is contained in:
Родитель
19afffc44c
Коммит
9fc1a8a71a
|
@ -147,12 +147,15 @@ RemoteLazyInputStreamThread::IsOnCurrentThread(bool* aRetval) {
|
|||
NS_IMETHODIMP
|
||||
RemoteLazyInputStreamThread::Dispatch(already_AddRefed<nsIRunnable> aRunnable,
|
||||
uint32_t aFlags) {
|
||||
nsCOMPtr<nsIRunnable> runnable(aRunnable);
|
||||
|
||||
if (RLISThreadIsInOrBeyondShutdown()) {
|
||||
// nsIEventTarget::Dispatch must leak the runnable if the dispatch fails.
|
||||
(void)runnable.forget();
|
||||
|
||||
return NS_ERROR_ILLEGAL_DURING_SHUTDOWN;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIRunnable> runnable(aRunnable);
|
||||
|
||||
StaticMutexAutoLock lock(gRemoteLazyThreadMutex);
|
||||
|
||||
return mThread->Dispatch(runnable.forget(), aFlags);
|
||||
|
|
Загрузка…
Ссылка в новой задаче