mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Merge "res_pjsip_session: Add cleanup to ast_sip_session_terminate" into 13
This commit is contained in:
@@ -2005,11 +2005,16 @@ static int hangup(void *data)
|
||||
struct ast_sip_session *session = channel->session;
|
||||
int cause = h_data->cause;
|
||||
|
||||
ast_sip_session_terminate(session, cause);
|
||||
/*
|
||||
* It's possible that session_terminate might cause the session to be destroyed
|
||||
* immediately so we need to keep a reference to it so we can NULL session->channel
|
||||
* afterwards.
|
||||
*/
|
||||
ast_sip_session_terminate(ao2_bump(session), cause);
|
||||
clear_session_and_channel(session, ast, pvt);
|
||||
ao2_cleanup(session);
|
||||
ao2_cleanup(channel);
|
||||
ao2_cleanup(h_data);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user