Forráskód Böngészése

clearTimeout instead of clearInterval for timers

We create timeouts, not intervals. Then we need to clear them with
clearTimeout.
Anton Lundin 12 éve
szülő
commit
c39df031d8
1 módosított fájl, 3 hozzáadás és 3 törlés
  1. 3 3
      include/rfb.js

+ 3 - 3
include/rfb.js

@@ -403,7 +403,7 @@ updateState = function(state, statusMsg) {
         }
         }
 
 
         if (msgTimer) {
         if (msgTimer) {
-            clearInterval(msgTimer);
+            clearTimeout(msgTimer);
             msgTimer = null;
             msgTimer = null;
         }
         }
 
 
@@ -444,13 +444,13 @@ updateState = function(state, statusMsg) {
 
 
     if (connTimer && (rfb_state !== 'connect')) {
     if (connTimer && (rfb_state !== 'connect')) {
         Util.Debug("Clearing connect timer");
         Util.Debug("Clearing connect timer");
-        clearInterval(connTimer);
+        clearTimeout(connTimer);
         connTimer = null;
         connTimer = null;
     }
     }
 
 
     if (disconnTimer && (rfb_state !== 'disconnect')) {
     if (disconnTimer && (rfb_state !== 'disconnect')) {
         Util.Debug("Clearing disconnect timer");
         Util.Debug("Clearing disconnect timer");
-        clearInterval(disconnTimer);
+        clearTimeout(disconnTimer);
         disconnTimer = null;
         disconnTimer = null;
     }
     }