]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_pjsip_session: Release media resources on session end quicker.
authorJoshua Colp <jcolp@digium.com>
Wed, 26 Jul 2017 16:39:32 +0000 (16:39 +0000)
committerGeorge Joseph <gjoseph@digium.com>
Tue, 1 Aug 2017 21:44:30 +0000 (15:44 -0600)
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: I3c6a82fe7d2c50b9dc9197cb12ef22f20d337501

res/res_pjsip_session.c

index 9cb80384c38378f0b67e1460b4d26cc9b08be55a..8256d3cf08929470b4863aa62fffd5736dfc264f 100644 (file)
@@ -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;
 }