File tree 1 file changed +11
-9
lines changed
Filter options
1 file changed +11
-9
lines changed
Original file line number Diff line number Diff line change @@ -1751,6 +1751,15 @@ - (void)flagsChanged:(NSEvent *)event
1751
1751
(void *) self, (void *)(self->timer ));
1752
1752
}
1753
1753
1754
+ static void
1755
+ Timer__timer_stop_impl (Timer* self)
1756
+ {
1757
+ if (self->timer ) {
1758
+ [self ->timer invalidate ];
1759
+ self->timer = NULL ;
1760
+ }
1761
+ }
1762
+
1754
1763
static PyObject*
1755
1764
Timer__timer_start (Timer* self, PyObject* args)
1756
1765
{
@@ -1769,6 +1778,8 @@ - (void)flagsChanged:(NSEvent *)event
1769
1778
goto exit ;
1770
1779
}
1771
1780
1781
+ // Stop the current timer if it is already running
1782
+ Timer__timer_stop_impl (self);
1772
1783
// hold a reference to the timer so we can invalidate/stop it later
1773
1784
self->timer = [NSTimer scheduledTimerWithTimeInterval: interval
1774
1785
repeats: !single
@@ -1794,15 +1805,6 @@ - (void)flagsChanged:(NSEvent *)event
1794
1805
}
1795
1806
}
1796
1807
1797
- static void
1798
- Timer__timer_stop_impl (Timer* self)
1799
- {
1800
- if (self->timer ) {
1801
- [self ->timer invalidate ];
1802
- self->timer = NULL ;
1803
- }
1804
- }
1805
-
1806
1808
static PyObject*
1807
1809
Timer__timer_stop (Timer* self)
1808
1810
{
You can’t perform that action at this time.
0 commit comments