Created
November 25, 2008 00:46
-
-
Save tolmasky/28722 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/Foundation/CPTimer.j | |
+++ b/Foundation/CPTimer.j | |
@@ -243,13 +243,13 @@ var _CPTimerBridgeTimer = function(codeOrFunction, aDelay, shouldRepeat, functio | |
theFunction = nil; | |
if (typeof codeOrFunction === "string") | |
- theFunction = function() { new Function(codeOrFunction)(); CPTimersForTimeoutIDs[timeoutID] = nil; } | |
+ theFunction = function() { new Function(codeOrFunction)(); if (!shouldRepeat) CPTimersForTimeoutIDs[timeoutID] = nil; } | |
else | |
{ | |
if (!functionArgs) | |
functionArgs = []; | |
- theFunction = function() { codeOrFunction.apply(window, functionArgs); CPTimersForTimeoutIDs[timeoutID] = nil; } | |
+ theFunction = function() { codeOrFunction.apply(window, functionArgs); if (!shouldRepeat) CPTimersForTimeoutIDs[timeoutID] = nil; } | |
} | |
CPTimersForTimeoutIDs[timeoutID] = [CPTimer scheduledTimerWithTimeInterval:aDelay / 1000 callback:theFunction repeats:shouldRepeat]; | |
@@ -268,6 +268,8 @@ window.clearTimeout = function(aTimeoutID) | |
if (timer) | |
[timer invalidate]; | |
+ | |
+ CPTimersForTimeoutIDs[aTimeoutID] = nil; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment