diff --git a/app/src/main/java/org/koitharu/kotatsu/download/ui/service/DownloadService.kt b/app/src/main/java/org/koitharu/kotatsu/download/ui/service/DownloadService.kt index d44204533..03712d889 100644 --- a/app/src/main/java/org/koitharu/kotatsu/download/ui/service/DownloadService.kt +++ b/app/src/main/java/org/koitharu/kotatsu/download/ui/service/DownloadService.kt @@ -16,7 +16,6 @@ import androidx.lifecycle.lifecycleScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow -import kotlinx.coroutines.flow.collect import kotlinx.coroutines.flow.mapLatest import kotlinx.coroutines.isActive import kotlinx.coroutines.launch @@ -79,6 +78,11 @@ class DownloadService : BaseService() { return binder ?: DownloadBinder(this).also { binder = it } } + override fun onUnbind(intent: Intent?): Boolean { + binder = null + return super.onUnbind(intent) + } + override fun onDestroy() { unregisterReceiver(controlReceiver) binder = null