aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil Hodgson <nyamatongwe@gmail.com>2015-09-02 09:04:35 +1000
committerNeil Hodgson <nyamatongwe@gmail.com>2015-09-02 09:04:35 +1000
commitced408c0d20b2436a4e2b379175de742575caf66 (patch)
tree87d90e049c2824dcc86a5b6c4288a495d5b05dec
parent295a956417888cec78625394769a29875a446ba7 (diff)
downloadscintilla-mirror-ced408c0d20b2436a4e2b379175de742575caf66.tar.gz
Schedule the timer after setting its tolerance to avoid scheduling twice.
-rw-r--r--cocoa/ScintillaCocoa.mm11
1 files changed, 6 insertions, 5 deletions
diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm
index e12f7a934..2abf1d3e0 100644
--- a/cocoa/ScintillaCocoa.mm
+++ b/cocoa/ScintillaCocoa.mm
@@ -947,16 +947,17 @@ bool ScintillaCocoa::FineTickerRunning(TickReason reason)
void ScintillaCocoa::FineTickerStart(TickReason reason, int millis, int tolerance)
{
FineTickerCancel(reason);
- NSTimer *fineTimer = [NSTimer scheduledTimerWithTimeInterval: millis / 1000.0
- target: timerTarget
- selector: @selector(timerFired:)
- userInfo: nil
- repeats: YES];
+ NSTimer *fineTimer = [NSTimer timerWithTimeInterval: millis / 1000.0
+ target: timerTarget
+ selector: @selector(timerFired:)
+ userInfo: nil
+ repeats: YES];
if (tolerance && [fineTimer respondsToSelector: @selector(setTolerance:)])
{
[fineTimer setTolerance: tolerance / 1000.0];
}
timers[reason] = fineTimer;
+ [[NSRunLoop currentRunLoop] addTimer:fineTimer forMode:NSDefaultRunLoopMode];
}
//--------------------------------------------------------------------------------------------------