Страница 1 из 1

Ошибка при освобождении TextToSpeech

Добавлено: 05 июн 2014, 21:54
Realist
В сервисе в onDestroy() пытаюсь освободить TTS

Код: Выделить всё

if (tts != null) {
	tts.stop();
	tts.shutdown();
	}
Выдает такую ошибку. Подскажите пожалуйста отчего такое может быть. При этом приложение не крашится, но все равно напрягает.

Код: Выделить всё

Service edu.cmu.Voice_SMS_Reader.Service1 has leaked ServiceConnection android.speech.tts.TextToSpeech$Connection@4174afb0 that was originally bound here
android.app.ServiceConnectionLeaked: Service edu.cmu.Voice_SMS_Reader.Service1 has leaked ServiceConnection android.speech.tts.TextToSpeech$Connection@4174afb0 that was originally bound her
at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:974)
at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:868)
at android.app.ContextImpl.bindService(ContextImpl.java:1728)
at android.app.ContextImpl.bindService(ContextImpl.java:1717)
at android.content.ContextWrapper.bindService(ContextWrapper.java:480)
at android.speech.tts.TextToSpeech.connectToEngine(TextToSpeech.java:629)
at android.speech.tts.TextToSpeech.initTts(TextToSpeech.java:598)
at android.speech.tts.TextToSpeech.<init>(TextToSpeech.java:554)
at android.speech.tts.TextToSpeech.<init>(TextToSpeech.java:528)
at android.speech.tts.TextToSpeech.<init>(TextToSpeech.java:513)
at edu.cmu.Voice_SMS_Reader.Service1.onCreate(Service1.java:132)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2598)
at android.app.ActivityThread.access$1700(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1372)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5306)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)

Re: Ошибка при освобождении TextToSpeech

Добавлено: 08 июн 2014, 10:39
altwin