Make `cancel` in `SleepTimer` synchronized too
This commit is contained in:
parent
82c4acc96f
commit
c59108e1ad
|
@ -20,7 +20,7 @@ object SleepTimer {
|
|||
val timeLeft = _timeLeft.asSharedFlow()
|
||||
private val scope = CoroutineScope(Dispatchers.Default)
|
||||
|
||||
fun cancel() {
|
||||
fun cancel() = synchronized(this@SleepTimer) {
|
||||
sleepTimer?.cancel()
|
||||
sleepTimer = null
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue