Commit 5048af8c authored by Simon Morlat's avatar Simon Morlat

fix crash when a listening point is cleared in the context of a callback invoked by a channel.

parent 70c6de05
......@@ -686,6 +686,7 @@ static int belle_sip_channel_process_read_data(belle_sip_channel_t *obj){
int belle_sip_channel_process_data(belle_sip_channel_t *obj,unsigned int revents){
int ret=BELLE_SIP_CONTINUE;
belle_sip_object_ref(obj);
if (revents & BELLE_SIP_EVENT_READ) {
int rret=belle_sip_channel_process_read_data(obj);
if (rret==BELLE_SIP_STOP) ret=BELLE_SIP_STOP;
......@@ -698,6 +699,7 @@ int belle_sip_channel_process_data(belle_sip_channel_t *obj,unsigned int revents
channel_process_queue(obj);
}
}
belle_sip_object_unref(obj);
return ret;
}
......
......@@ -185,7 +185,14 @@ belle_sip_uri_t *belle_sip_channel_create_routable_uri(belle_sip_channel_t *chan
void channel_set_state(belle_sip_channel_t *obj, belle_sip_channel_state_t state);
/*just invokes the listeners to process data*/
/*
* Process incoming data and synchronously invoke the listeners if
* complete message are received. The invocation of the listeners may
* result in the channel being destroyed (ex: calling belle_sip_listening_point_clean_channels() within
* a transaction completed notification).
* WARNING: As a result, the caller of this function must be take into account that the channel no longer exists
* in return from this function.
*/
int belle_sip_channel_process_data(belle_sip_channel_t *obj,unsigned int revents);
/*this function is to be used only in belle_sip_listening_point_clean_channels()*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment