speech_channel_t *schannel = (speech_channel_t *) ah->private_info;
recognizer_data_t *r = (recognizer_data_t *) schannel->data;
speech_channel_stop(schannel);
- speech_channel_destroy(schannel);
switch_core_hash_destroy(&r->grammars);
switch_core_hash_destroy(&r->enabled_grammars);
if (r->dtmf_generator) {
mpf_dtmf_generator_destroy(r->dtmf_generator);
}
+ speech_channel_destroy(schannel);
/* this lets FreeSWITCH's speech_thread know the handle is closed */
switch_set_flag(ah, SWITCH_ASR_FLAG_CLOSED);