Revert an errant part of a previous cleanup, to fix a memory corruption issue.
(closes issue #16368) Reported by: thirionjwf Patches: res_speech.c.patch uploaded by thirionjwf (license 955) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@247841 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
df209a3f23
commit
7774002c87
|
@ -313,8 +313,9 @@ int ast_speech_unregister(const char *engine_name)
|
|||
/* We have our engine... removed it */
|
||||
AST_RWLIST_REMOVE_CURRENT(list);
|
||||
/* If this was the default engine, we need to pick a new one */
|
||||
if (!default_engine)
|
||||
if (engine == default_engine) {
|
||||
default_engine = AST_RWLIST_FIRST(&engines);
|
||||
}
|
||||
ast_verb(2, "Unregistered speech recognition engine '%s'\n", engine_name);
|
||||
/* All went well */
|
||||
res = 0;
|
||||
|
|
Reference in New Issue