kunfei 3 年 前
親
コミット
83179e5f97

+ 4 - 2
app/src/main/java/io/legado/app/service/TTSReadAloudService.kt

@@ -52,8 +52,10 @@ class TTSReadAloudService : BaseReadAloudService(), TextToSpeech.OnInitListener
 
     @Synchronized
     fun clearTTS() {
-        textToSpeech?.stop()
-        textToSpeech?.shutdown()
+        textToSpeech?.runCatching {
+            stop()
+            shutdown()
+        }
         textToSpeech = null
         ttsInitFinish = false
     }