зеркало из https://github.com/mozilla/gecko-dev.git
Bug 984708 - Make sure we clear out the shutdown timer no matter what. r=bent
This commit is contained in:
Родитель
343d4e1ea6
Коммит
b356dfdf64
|
@ -980,6 +980,7 @@ ParentImpl::ShutdownBackgroundThread()
|
|||
AssertIsOnMainThread();
|
||||
MOZ_ASSERT_IF(!sBackgroundThread, !sBackgroundThreadMessageLoop);
|
||||
MOZ_ASSERT_IF(!sShutdownHasStarted, !sLiveActorCount);
|
||||
MOZ_ASSERT_IF(!sBackgroundThread, !sLiveActorCount);
|
||||
MOZ_ASSERT_IF(sBackgroundThread, sShutdownTimer);
|
||||
|
||||
if (sPendingCallbacks) {
|
||||
|
@ -1001,6 +1002,12 @@ ParentImpl::ShutdownBackgroundThread()
|
|||
}
|
||||
}
|
||||
|
||||
nsCOMPtr<nsITimer> shutdownTimer;
|
||||
if (sShutdownHasStarted) {
|
||||
shutdownTimer = sShutdownTimer.get();
|
||||
sShutdownTimer = nullptr;
|
||||
}
|
||||
|
||||
if (sBackgroundThread) {
|
||||
nsCOMPtr<nsIThread> thread = sBackgroundThread.get();
|
||||
nsAutoPtr<nsTArray<ParentImpl*>> liveActors(sLiveActorsForBackgroundThread);
|
||||
|
@ -1015,8 +1022,6 @@ ParentImpl::ShutdownBackgroundThread()
|
|||
// If this is final shutdown then we need to spin the event loop while we
|
||||
// wait for all the actors to be cleaned up. We also set a timeout to
|
||||
// force-kill any hanging actors.
|
||||
nsCOMPtr<nsITimer> shutdownTimer = sShutdownTimer.get();
|
||||
sShutdownTimer = nullptr;
|
||||
|
||||
if (sLiveActorCount) {
|
||||
TimerCallbackClosure closure(thread, liveActors);
|
||||
|
|
Загрузка…
Ссылка в новой задаче