diff options
Diffstat (limited to 'backends/text-to-speech/linux/linux-text-to-speech.cpp')
-rw-r--r-- | backends/text-to-speech/linux/linux-text-to-speech.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/backends/text-to-speech/linux/linux-text-to-speech.cpp b/backends/text-to-speech/linux/linux-text-to-speech.cpp index 633c107727..db036e053a 100644 --- a/backends/text-to-speech/linux/linux-text-to-speech.cpp +++ b/backends/text-to-speech/linux/linux-text-to-speech.cpp @@ -206,7 +206,8 @@ void LinuxTextToSpeechManager::setLanguage(Common::String language) { void LinuxTextToSpeechManager::createVoice(int typeNumber, Common::TTSVoice::Gender gender, Common::TTSVoice::Age age, char *description) { SPDVoiceType *type = (SPDVoiceType *) malloc(sizeof(SPDVoiceType)); *type = static_cast<SPDVoiceType>(typeNumber); - _ttsState->_availaibleVoices.push_back(Common::TTSVoice(gender, age, (void *) type, description)); + Common::TTSVoice voice(gender, age, (void *) type, description); + _ttsState->_availaibleVoices.push_back(voice); } void LinuxTextToSpeechManager::updateVoices() { @@ -238,10 +239,6 @@ bool LinuxTextToSpeechManager::popState() { if (_ttsState->_next == nullptr) return true; - for (Common::TTSVoice *i = _ttsState->_availaibleVoices.begin(); i < _ttsState->_availaibleVoices.end(); i++) { - free(i->getData()); - } - Common::TTSState *oldState = _ttsState; _ttsState = _ttsState->_next; @@ -254,5 +251,9 @@ bool LinuxTextToSpeechManager::popState() { return false; } +void LinuxTextToSpeechManager::freeVoiceData(void *data) { + free(data); +} + #endif |