timer doesn't always stop, so don't dispatch if interval is cleared

Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/80a55bb8
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/80a55bb8
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/80a55bb8

Branch: refs/heads/tlf
Commit: 80a55bb8cc3d820b90c7859c54de886a056745de
Parents: c341287
Author: Alex Harui <[email protected]>
Authored: Mon May 8 11:37:35 2017 -0700
Committer: Alex Harui <[email protected]>
Committed: Mon May 8 11:59:04 2017 -0700

----------------------------------------------------------------------
 .../projects/Core/src/main/flex/org/apache/flex/utils/Timer.as   | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/80a55bb8/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/Timer.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/Timer.as 
b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/Timer.as
index f16efb4..5372bdc 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/Timer.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/Timer.as
@@ -158,6 +158,10 @@ public class Timer extends EventDispatcher
     
     private function timerHandler():void
     {
+               // sometimes an interval gets called after you clear it
+               if (timerInterval == -1)
+                   return;
+                       
         _currentCount++;
         if (repeatCount > 0 && currentCount >= repeatCount) {
             stop();

Reply via email to