From 26bf329b9581985f04ccb26f41370a13836363ff Mon Sep 17 00:00:00 2001 From: Jaromir Wysoglad Date: Thu, 5 Sep 2019 22:02:28 +0200 Subject: TTS: Fix possible deadlock --- backends/text-to-speech/windows/windows-text-to-speech.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/backends/text-to-speech/windows/windows-text-to-speech.cpp b/backends/text-to-speech/windows/windows-text-to-speech.cpp index ceca3e4566..9e6d30cd3a 100644 --- a/backends/text-to-speech/windows/windows-text-to-speech.cpp +++ b/backends/text-to-speech/windows/windows-text-to-speech.cpp @@ -128,6 +128,7 @@ DWORD WINAPI startSpeech(LPVOID parameters) { WaitForSingleObject(*params->mutex, INFINITE); // check again, when we have exclusive access to the queue if (params->queue->empty() || *(params->state) == WindowsTextToSpeechManager::PAUSED) { + ReleaseMutex(*params->mutex); break; } WCHAR *currentSpeech = params->queue->front(); -- cgit v1.2.3