mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-18 01:28:42 +00:00
FS-6051 --resolve mod_rayo - double destroy of output component
This commit is contained in:
parent
db3f50d1ae
commit
ff7428605a
@ -122,6 +122,8 @@ struct rayo_component {
|
|||||||
const char *client_jid;
|
const char *client_jid;
|
||||||
/** external ref */
|
/** external ref */
|
||||||
const char *ref;
|
const char *ref;
|
||||||
|
/** true if component has completed */
|
||||||
|
int complete;
|
||||||
/** optional cleanup */
|
/** optional cleanup */
|
||||||
rayo_actor_cleanup_fn cleanup_fn;
|
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)
|
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_SEND_REPLY(component, iks_find_attrib(response, "to"), response);
|
||||||
RAYO_UNLOCK(component);
|
RAYO_UNLOCK(component);
|
||||||
RAYO_DESTROY(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) {
|
if (switch_ivr_displace_session(session, stream.data, 0, "m") == SWITCH_STATUS_SUCCESS) {
|
||||||
RAYO_UNLOCK(component);
|
RAYO_UNLOCK(component);
|
||||||
} else {
|
} else {
|
||||||
if (OUTPUT_COMPONENT(component)->document) {
|
if (component->complete) {
|
||||||
iks_delete(OUTPUT_COMPONENT(component)->document);
|
/* component is already destroyed */
|
||||||
}
|
RAYO_UNLOCK(component);
|
||||||
if (switch_channel_get_state(switch_core_session_get_channel(session)) >= CS_HANGUP) {
|
|
||||||
rayo_component_send_complete(component, COMPONENT_COMPLETE_HANGUP);
|
|
||||||
component = NULL;
|
|
||||||
} else {
|
} else {
|
||||||
rayo_component_send_complete(component, COMPONENT_COMPLETE_ERROR);
|
/* need to destroy component */
|
||||||
component = NULL;
|
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);
|
switch_safe_free(stream.data);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user