mirror of
https://github.com/SimpleMobileTools/Simple-Flashlight.git
synced 2025-06-05 21:59:19 +02:00
Make cancel
in SleepTimer
synchronized too
This commit is contained in:
@ -20,7 +20,7 @@ object SleepTimer {
|
|||||||
val timeLeft = _timeLeft.asSharedFlow()
|
val timeLeft = _timeLeft.asSharedFlow()
|
||||||
private val scope = CoroutineScope(Dispatchers.Default)
|
private val scope = CoroutineScope(Dispatchers.Default)
|
||||||
|
|
||||||
fun cancel() {
|
fun cancel() = synchronized(this@SleepTimer) {
|
||||||
sleepTimer?.cancel()
|
sleepTimer?.cancel()
|
||||||
sleepTimer = null
|
sleepTimer = null
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user