提交 ff742860 authored 作者: Chris Rienzo's avatar Chris Rienzo

FS-6051 --resolve mod_rayo - double destroy of output component

上级 db3f50d1
......@@ -122,6 +122,8 @@ struct rayo_component {
const char *client_jid;
/** external ref */
const char *ref;
/** true if component has completed */
int complete;
/** optional cleanup */
rayo_actor_cleanup_fn cleanup_fn;
};
......
......@@ -112,6 +112,7 @@ iks *rayo_component_create_complete_event(struct rayo_component *component, cons
*/
void rayo_component_send_complete_event(struct rayo_component *component, iks *response)
{
component->complete = 1;
RAYO_SEND_REPLY(component, iks_find_attrib(response, "to"), response);
RAYO_UNLOCK(component);
RAYO_DESTROY(component);
......
......@@ -105,15 +105,19 @@ static iks *start_call_output(struct rayo_component *component, switch_core_sess
if (switch_ivr_displace_session(session, stream.data, 0, "m") == SWITCH_STATUS_SUCCESS) {
RAYO_UNLOCK(component);
} else {
if (OUTPUT_COMPONENT(component)->document) {
iks_delete(OUTPUT_COMPONENT(component)->document);
}
if (switch_channel_get_state(switch_core_session_get_channel(session)) >= CS_HANGUP) {
rayo_component_send_complete(component, COMPONENT_COMPLETE_HANGUP);
component = NULL;
if (component->complete) {
/* component is already destroyed */
RAYO_UNLOCK(component);
} else {
rayo_component_send_complete(component, COMPONENT_COMPLETE_ERROR);
component = NULL;
/* need to destroy component */
if (OUTPUT_COMPONENT(component)->document) {
iks_delete(OUTPUT_COMPONENT(component)->document);
}
if (switch_channel_get_state(switch_core_session_get_channel(session)) >= CS_HANGUP) {
rayo_component_send_complete(component, COMPONENT_COMPLETE_HANGUP);
} else {
rayo_component_send_complete(component, COMPONENT_COMPLETE_ERROR);
}
}
}
switch_safe_free(stream.data);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论