mirror of https://github.com/kivy/kivy.git
Track whether the clock has started. (#7810)
This commit is contained in:
parent
1c83cdf2c7
commit
2effe2ed03
|
@ -95,6 +95,7 @@ cdef class CyClockBase(object):
|
|||
cdef public object _lock_acquire
|
||||
cdef public object _lock_release
|
||||
|
||||
cdef public int has_started
|
||||
cdef public int has_ended
|
||||
cdef public object _del_safe_lock
|
||||
cdef public int _del_safe_done
|
||||
|
|
|
@ -260,6 +260,7 @@ cdef class CyClockBase(object):
|
|||
self._del_safe_lock = RLock()
|
||||
self._del_safe_done = False
|
||||
self.has_ended = False
|
||||
self.has_started = False
|
||||
|
||||
def start_clock(self):
|
||||
"""Must be called to start the clock.
|
||||
|
@ -268,7 +269,10 @@ cdef class CyClockBase(object):
|
|||
"""
|
||||
self._lock_acquire()
|
||||
try:
|
||||
pass
|
||||
if self.has_started:
|
||||
return
|
||||
|
||||
self.has_started = True
|
||||
# for now don't raise an exception when restarting because kivy's
|
||||
# graphical tests are not setup to handle clock isolation so they try
|
||||
# to restart the clock
|
||||
|
|
Loading…
Reference in New Issue