diff options
author | Neil Hodgson <nyamatongwe@gmail.com> | 2015-09-02 09:04:35 +1000 |
---|---|---|
committer | Neil Hodgson <nyamatongwe@gmail.com> | 2015-09-02 09:04:35 +1000 |
commit | ced408c0d20b2436a4e2b379175de742575caf66 (patch) | |
tree | 87d90e049c2824dcc86a5b6c4288a495d5b05dec | |
parent | 295a956417888cec78625394769a29875a446ba7 (diff) | |
download | scintilla-mirror-ced408c0d20b2436a4e2b379175de742575caf66.tar.gz |
Schedule the timer after setting its tolerance to avoid scheduling twice.
-rw-r--r-- | cocoa/ScintillaCocoa.mm | 11 |
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]; } //-------------------------------------------------------------------------------------------------- |