From 3419f6fbb4215a437ea943de8cb3897c37802447 Mon Sep 17 00:00:00 2001 From: Blair Duncan Date: Thu, 18 Jul 2013 09:33:12 -0400 Subject: [PATCH] Fixed: CPTimer number of seconds interval set to 0.1 if less than or equal to 0.0 Cocoa specs here: https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSTimer_Class/Reference/NSTimer.html ... "Parameters seconds The number of seconds between firings of the timer. If seconds is less than or equal to 0.0, this method chooses the nonnegative value of 0.1 milliseconds instead." --- Foundation/CPTimer.j | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Foundation/CPTimer.j b/Foundation/CPTimer.j index 855fed96c..910456485 100644 --- a/Foundation/CPTimer.j +++ b/Foundation/CPTimer.j @@ -112,7 +112,7 @@ if (self) { - _timeInterval = seconds; + _timeInterval = MAX(seconds,0.1); _invocation = anInvocation; _repeats = shouldRepeat; _isValid = YES; @@ -150,7 +150,7 @@ if (self) { - _timeInterval = seconds; + _timeInterval = MAX(seconds,0.1); _callback = aFunction; _repeats = shouldRepeat; _isValid = YES;