Commit eeaa5ec7 authored by Simon Morlat's avatar Simon Morlat
Browse files

fix memory leak and unordered destructions

parent 5f49ee2e
......@@ -47,12 +47,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
void audio_stream_free(AudioStream *stream)
{
if (stream->session!=NULL) {
rtp_session_unregister_event_queue(stream->session,stream->evq);
rtp_session_destroy(stream->session);
if (stream->ortpZrtpContext != NULL) {
ortp_zrtp_context_destroy(stream->ortpZrtpContext);
stream->ortpZrtpContext=NULL;
}
rtp_session_unregister_event_queue(stream->session,stream->evq);
rtp_session_destroy(stream->session);
}
if (stream->evq) ortp_ev_queue_destroy(stream->evq);
if (stream->rtpsend!=NULL) ms_filter_destroy(stream->rtpsend);
......
......@@ -39,6 +39,8 @@ extern RtpSession * create_duplex_rtpsession( int locport, bool_t ipv6);
/* this code is not part of the library itself, it is part of the mediastream program */
void video_stream_free (VideoStream * stream)
{
if (stream->ortpZrtpContext)
ortp_zrtp_context_destroy(stream->ortpZrtpContext);
if (stream->session!=NULL){
rtp_session_unregister_event_queue(stream->session,stream->evq);
rtp_session_destroy(stream->session);
......
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