diff options
author | Jaromir Wysoglad | 2019-07-18 11:27:17 +0200 |
---|---|---|
committer | Filippos Karapetis | 2019-09-01 22:47:55 +0300 |
commit | 5d9f03e71d75a307c8f8e538803fe2f09f38c5ae (patch) | |
tree | e472499cd024f74e211dc6cd63c578d300f20e92 /backends/text-to-speech/windows | |
parent | 8e4a24f55e2986de6c0556ab1a0faeeca20c724f (diff) | |
download | scummvm-rg350-5d9f03e71d75a307c8f8e538803fe2f09f38c5ae.tar.gz scummvm-rg350-5d9f03e71d75a307c8f8e538803fe2f09f38c5ae.tar.bz2 scummvm-rg350-5d9f03e71d75a307c8f8e538803fe2f09f38c5ae.zip |
TTS: Add reference counting to TTSVoice
Also refactor TTSVoice destruction to use this reference counting.
Diffstat (limited to 'backends/text-to-speech/windows')
-rw-r--r-- | backends/text-to-speech/windows/windows-text-to-speech.cpp | 4 | ||||
-rw-r--r-- | backends/text-to-speech/windows/windows-text-to-speech.h | 2 |
2 files changed, 6 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 f688ec1cd5..fec5a408d1 100644 --- a/backends/text-to-speech/windows/windows-text-to-speech.cpp +++ b/backends/text-to-speech/windows/windows-text-to-speech.cpp @@ -360,5 +360,9 @@ bool WindowsTextToSpeechManager::popState() { setVoice(_ttsState->_activeVoice); return false; } +void WindowsTextToSpeechManager::freeVoiceData(void *data) { + ISpObjectToken *voiceToken = (ISpObjectToken *) data; + voiceToken->Release(); +} #endif diff --git a/backends/text-to-speech/windows/windows-text-to-speech.h b/backends/text-to-speech/windows/windows-text-to-speech.h index 03a1806849..2ae062ce92 100644 --- a/backends/text-to-speech/windows/windows-text-to-speech.h +++ b/backends/text-to-speech/windows/windows-text-to-speech.h @@ -66,6 +66,8 @@ public: virtual bool popState(); + virtual void freeVoiceData(void *data); + private: void init(); virtual void updateVoices(); |