зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1339617 - move GetClosure call prior to canceling timer; r=mayhemer
Some recent work on timers changed how we handle callbacks and associated closure data: prior to these changes, canceling timers would not null out associated closure data, so calling GetClosure() on a timer after canceling it would return what you had put in. After these changes, however, GetClosure() after cancellation would retrieve a null value, causing anything that assumed non-nullness to crash. The simple fix is to move the GetClosure() call prior to Cancel()'ing the timer.
This commit is contained in:
Родитель
13a46e3d87
Коммит
2f23818440
|
@ -80,10 +80,10 @@ nsDeleteDir::Shutdown(bool finishDeleting)
|
|||
for (int32_t i = gInstance->mTimers.Count(); i > 0; i--) {
|
||||
nsCOMPtr<nsITimer> timer = gInstance->mTimers[i-1];
|
||||
gInstance->mTimers.RemoveObjectAt(i-1);
|
||||
timer->Cancel();
|
||||
|
||||
nsCOMArray<nsIFile> *arg;
|
||||
timer->GetClosure((reinterpret_cast<void**>(&arg)));
|
||||
timer->Cancel();
|
||||
|
||||
if (finishDeleting)
|
||||
dirsToRemove.AppendObjects(*arg);
|
||||
|
|
Загрузка…
Ссылка в новой задаче