Bug 1345751. P1 - remove the else branch for MediaShutdownManager ensures all media activities are finished before "xpcom-shutdown-threads" starts. r=cpearce

MozReview-Commit-ID: BdNnlHEb1Nk

--HG--
extra : rebase_source : c591fe6cf1fbe95fec4459b6129e1aca5b6d7eef
extra : source : fa7f0e9676a271da0d7693d4a6a8c63862187fee
This commit is contained in:
JW Wang 2017-03-09 14:45:09 +08:00
Родитель 7c4d3ea96b
Коммит 9a968fa4e3
1 изменённых файлов: 3 добавлений и 9 удалений

Просмотреть файл

@ -75,15 +75,9 @@ void FileBlockCache::Close()
// releasing memory etc! Also note we close mFD in the destructor so
// as to not disturb any IO that's currently running.
nsCOMPtr<nsIThread> mainThread = do_GetMainThread();
if (mainThread) {
nsCOMPtr<nsIRunnable> event = new ShutdownThreadEvent(mThread);
mainThread->Dispatch(event.forget(), NS_DISPATCH_NORMAL);
} else {
// we're on Mainthread already, *and* the event queues are already
// shut down, so no events should occur - certainly not creations of
// new streams.
mThread->Shutdown();
}
MOZ_ASSERT(mainThread);
nsCOMPtr<nsIRunnable> event = new ShutdownThreadEvent(mThread);
mainThread->Dispatch(event.forget(), NS_DISPATCH_NORMAL);
}
}