diff --git a/app/src/main/java/io/legado/app/service/AudioPlayService.kt b/app/src/main/java/io/legado/app/service/AudioPlayService.kt index 664e48e19..fdd8f7a58 100644 --- a/app/src/main/java/io/legado/app/service/AudioPlayService.kt +++ b/app/src/main/java/io/legado/app/service/AudioPlayService.kt @@ -87,8 +87,11 @@ class AudioPlayService : BaseService(), override fun onDestroy() { super.onDestroy() isRun = false + handler.removeCallbacks(dsRunnable) + handler.removeCallbacks(mpRunnable) mediaPlayer.release() mediaSessionCompat?.release() + unregisterReceiver(broadcastReceiver) upMediaSessionPlaybackState(PlaybackStateCompat.STATE_STOPPED) postEvent(Bus.AUDIO_STATE, Status.STOP) }