[Freeswitch-svn] [commit] r13784 - freeswitch/trunk/src

FreeSWITCH SVN anthm at freeswitch.org
Tue Jun 16 10:39:03 PDT 2009


Author: anthm
Date: Tue Jun 16 12:39:03 2009
New Revision: 13784

Log:
declinatio mortuus obfirmo

Modified:
   freeswitch/trunk/src/switch_core_asr.c
   freeswitch/trunk/src/switch_core_speech.c

Modified: freeswitch/trunk/src/switch_core_asr.c
==============================================================================
--- freeswitch/trunk/src/switch_core_asr.c	(original)
+++ freeswitch/trunk/src/switch_core_asr.c	Tue Jun 16 12:39:03 2009
@@ -77,7 +77,14 @@
 	ah->rate = rate;
 	ah->name = switch_core_strdup(ah->memory_pool, module_name);
 
-	return ah->asr_interface->asr_open(ah, codec, rate, dest, flags);
+	status = ah->asr_interface->asr_open(ah, codec, rate, dest, flags);
+
+	if (status != SWITCH_STATUS_SUCCESS) {
+		UNPROTECT_INTERFACE(ah->asr_interface);
+	}
+
+	return status;
+
 }
 
 SWITCH_DECLARE(switch_status_t) switch_core_asr_load_grammar(switch_asr_handle_t *ah, const char *grammar, const char *name)

Modified: freeswitch/trunk/src/switch_core_speech.c
==============================================================================
--- freeswitch/trunk/src/switch_core_speech.c	(original)
+++ freeswitch/trunk/src/switch_core_speech.c	Tue Jun 16 12:39:03 2009
@@ -86,6 +86,8 @@
 
 	if ((status = sh->speech_interface->speech_open(sh, voice_name, rate, flags)) == SWITCH_STATUS_SUCCESS) {
 		switch_set_flag(sh, SWITCH_SPEECH_FLAG_OPEN);
+	} else {
+		UNPROTECT_INTERFACE(sh->speech_interface);
 	}
 
 	return status;



More information about the Freeswitch-svn mailing list