Skip to content

Commit f4649e8

Browse files
committed
Stop playback on main thread. fix #1490
1 parent 9e72942 commit f4649e8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/shared/src/commonMain/kotlin/ui/subject/episode/EpisodeViewModel.kt

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2024 OpenAni and contributors.
2+
* Copyright (C) 2024-2025 OpenAni and contributors.
33
*
44
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
55
* Use of this source code is governed by the GNU AGPLv3 license, which can be found at the following link.
@@ -634,7 +634,9 @@ class EpisodeViewModel(
634634
super.onCleared()
635635
backgroundScope.launch(NonCancellable + CoroutineName("EpisodeViewModel#onCleared")) {
636636
fetchPlayState.onClose()
637-
player.stopPlayback()
637+
withContext(Dispatchers.Main) {
638+
player.stopPlayback()
639+
}
638640
}
639641
}
640642

0 commit comments

Comments
 (0)