aboutsummaryrefslogtreecommitdiff
path: root/backends/text-to-speech/windows
diff options
context:
space:
mode:
authorBastien Bouclet2019-11-15 21:24:22 +0100
committerBastien Bouclet2019-11-15 21:24:22 +0100
commit34bf3f2de0e2722f8a6e951e8fb5be069ba7299f (patch)
tree3d59490a3dcb2c2d467d0f7ccf24b25dee6503db /backends/text-to-speech/windows
parentc87ca97b2252999f3edb326cfd7a22fc639fbb64 (diff)
downloadscummvm-rg350-34bf3f2de0e2722f8a6e951e8fb5be069ba7299f.tar.gz
scummvm-rg350-34bf3f2de0e2722f8a6e951e8fb5be069ba7299f.tar.bz2
scummvm-rg350-34bf3f2de0e2722f8a6e951e8fb5be069ba7299f.zip
TTS: Fix use of virtual function in TTSMan destructor
TextToSpeechManager::freeVoiceData was called while the virtual function table pointer was already reset by the parent class destructor.
Diffstat (limited to 'backends/text-to-speech/windows')
-rw-r--r--backends/text-to-speech/windows/windows-text-to-speech.cpp3
1 files changed, 3 insertions, 0 deletions
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 9f4ecf742a..a398200bad 100644
--- a/backends/text-to-speech/windows/windows-text-to-speech.cpp
+++ b/backends/text-to-speech/windows/windows-text-to-speech.cpp
@@ -120,6 +120,9 @@ void WindowsTextToSpeechManager::init() {
WindowsTextToSpeechManager::~WindowsTextToSpeechManager() {
stop();
+
+ clearState();
+
if (_thread != NULL) {
WaitForSingleObject(_thread, INFINITE);
CloseHandle(_thread);