You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by gr...@apache.org on 2020/03/16 06:07:32 UTC

[royale-asjs] branch develop updated: Fix inconsistency in Timer. 'running' should be a getter, not a method. This obscure little thing was causing mayhem in mx.messaging for PollingChannel...

This is an automated email from the ASF dual-hosted git repository.

gregdove pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new b9871cc  Fix inconsistency in Timer. 'running' should be a getter, not a method. This obscure little thing was causing mayhem in mx.messaging for PollingChannel...
     new af8e839  Merge branch 'develop' of https://github.com/apache/royale-asjs into develop
b9871cc is described below

commit b9871cc512540a0f2bc99484b24f5a3b654fa8ac
Author: greg-dove <gr...@gmail.com>
AuthorDate: Mon Mar 16 19:06:57 2020 +1300

    Fix inconsistency in Timer. 'running' should be a getter, not a method. This obscure little thing was causing mayhem in mx.messaging for PollingChannel...
---
 .../src/main/royale/org/apache/royale/utils/Timer.as   | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/Timer.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/Timer.as
index ddbee84..ccbb730 100644
--- a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/Timer.as
+++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/Timer.as
@@ -140,7 +140,7 @@ public class Timer extends EventDispatcher
     public var delay:Number;
     public var repeatCount:int;
     
-	public function running():Boolean
+	public function get running():Boolean
 	{
 		return timerInterval != -1;
 	}
@@ -162,18 +162,18 @@ public class Timer extends EventDispatcher
     
     public function stop():void
     {
-        clearInterval(timerInterval);
-        timerInterval = -1;
+        if (timerInterval != -1){
+            clearInterval(timerInterval);
+            timerInterval = -1;
+        }
     }
     
     public function start():void
     {
-		// bail if already running.  Is less code than an
-		// isRunning flag?
-		if (timerInterval != -1) return; 
-		
-        timerInterval =
-            setInterval(timerHandler, delay);
+		// ignore if already running.  
+		if (timerInterval == -1) {
+            timerInterval = setInterval(timerHandler, delay);
+        }
     }
     
     private function timerHandler():void