mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-10 18:57:45 +00:00
FSMOD-35: mod_tts_commandline core dump, temp file problem.
flush can be called several times
This commit is contained in:
parent
9c4767456a
commit
3d089f0075
@ -186,10 +186,14 @@ static void tts_commandline_speech_flush_tts(switch_speech_handle_t *sh)
|
|||||||
{
|
{
|
||||||
tts_commandline_t *info = (tts_commandline_t *) sh->private_info;
|
tts_commandline_t *info = (tts_commandline_t *) sh->private_info;
|
||||||
assert(info != NULL);
|
assert(info != NULL);
|
||||||
|
|
||||||
switch_core_file_close(info->fh);
|
if (info->fh != NULL && info->fh->file_interface != NULL) {
|
||||||
if (unlink(info->file) != 0) {
|
switch_core_file_close(info->fh);
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Sound file [%s] delete failed\n", info->file);
|
}
|
||||||
|
if (switch_file_exists(info->file, NULL) == SWITCH_STATUS_SUCCESS) {
|
||||||
|
if (unlink(info->file) != 0) {
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Sound file [%s] delete failed\n", info->file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user