From: Joshua Colp Date: Wed, 26 Jul 2017 16:39:32 +0000 (+0000) Subject: res_pjsip_session: Release media resources on session end quicker. X-Git-Tag: 13.18.0-rc1~102^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0de7312facc79df9132c38959298ecfdce31628a;p=thirdparty%2Fasterisk.git res_pjsip_session: Release media resources on session end quicker. A change was made long ago where the session was kept around until the underlying INVITE session had been destroyed. This had the side effect of also keeping the underlying media resources around for this time as well. This change ensures that when we know the session is ending we release the media resources immediately. ASTERISK-27110 Change-Id: I643e431d5c3bf05cda220c1d39e824a505a29b82 --- diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c index 9cb80384c3..8256d3cf08 100644 --- a/res/res_pjsip_session.c +++ b/res/res_pjsip_session.c @@ -2554,6 +2554,11 @@ static int session_end(void *vsession) iter->session_end(session); } } + + /* Release any media resources. */ + ao2_cleanup(session->media); + session->media = NULL; + return 0; }