Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(984)

Unified Diff: runtime/bin/timer_impl.dart

Issue 9474004: Make FileInputStream and FileOutputStream actually asynchronous. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove accidental edit Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/bin/timer_impl.dart
diff --git a/runtime/bin/timer_impl.dart b/runtime/bin/timer_impl.dart
index 8274cf04f864baa74d31d6390662e42483bc2245..ed7884251a0af25047871605c5739ece9287479d 100644
--- a/runtime/bin/timer_impl.dart
+++ b/runtime/bin/timer_impl.dart
@@ -1,4 +1,4 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -142,10 +142,15 @@ class _Timer implements Timer {
_handling_callbacks = true;
try {
for (var timer in pending_timers) {
- timer._callback(timer);
- if (timer._repeating) {
- timer._advanceWakeupTime();
- timer._addTimerToList();
+ // One of the timers in the pending_timers list can cancel
+ // one of the later timers which will set the callback to
+ // null.
+ if (timer._callback != null) {
+ timer._callback(timer);
+ if (timer._repeating) {
+ timer._advanceWakeupTime();
+ timer._addTimerToList();
+ }
}
}
} finally {

Powered by Google App Engine
This is Rietveld 408576698