提交 3d089f00 authored 作者: Mathieu Parent's avatar Mathieu Parent

FSMOD-35: mod_tts_commandline core dump, temp file problem.

flush can be called several times
上级 9c476745
......@@ -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;
assert(info != NULL);
switch_core_file_close(info->fh);
if (unlink(info->file) != 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Sound file [%s] delete failed\n", info->file);
if (info->fh != NULL && info->fh->file_interface != NULL) {
switch_core_file_close(info->fh);
}
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);
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论