mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-27 05:32:45 +00:00
TTS: Resolve segfault when exiting scummvm
This commit is contained in:
parent
39e74b027e
commit
8c44b03231
@ -87,7 +87,7 @@ LinuxTextToSpeechManager::LinuxTextToSpeechManager()
|
||||
}
|
||||
|
||||
LinuxTextToSpeechManager::~LinuxTextToSpeechManager() {
|
||||
spd_close(_connection);
|
||||
//spd_close(_connection);
|
||||
}
|
||||
|
||||
void LinuxTextToSpeechManager::updateState(LinuxTextToSpeechManager::SpeechState state) {
|
||||
|
@ -38,6 +38,9 @@ TextToSpeechManager::~TextToSpeechManager() {
|
||||
TTSState *tmp = _ttsState;
|
||||
while (tmp != nullptr) {
|
||||
tmp = _ttsState->_next;
|
||||
for (TTSVoice *i = _ttsState->_availaibleVoices.begin(); i < _ttsState->_availaibleVoices.end(); i++) {
|
||||
free(i->_data);
|
||||
}
|
||||
delete _ttsState;
|
||||
_ttsState = tmp;
|
||||
}
|
||||
|
@ -48,7 +48,6 @@ class TTSVoice {
|
||||
TTSVoice(Gender gender, void *data)
|
||||
: _gender(gender)
|
||||
, _data(data) {}
|
||||
~TTSVoice() { debug("%d", * (int *)_data); if (_data != nullptr) free(_data); }
|
||||
Gender getGender() { return _gender; };
|
||||
void setGender(Gender gender) { _gender = gender; };
|
||||
void setData(void *data) { _data = data; };
|
||||
|
Loading…
x
Reference in New Issue
Block a user