diff options
author | Colin Guthrie <pulse@colin.guthr.ie> | 2008-05-11 17:02:19 +0000 |
---|---|---|
committer | Colin Guthrie <pulse@colin.guthr.ie> | 2008-10-08 20:32:08 +0100 |
commit | 3767cdb6d16c5817eb489129585fb353e3ad6afa (patch) | |
tree | 33f208b7ffe1ed5ca2ae83591224469c9b9229d4 /src/modules/rtp/rtsp_client.c | |
parent | 92166846913ebb5e86f36352e20c9ca4f4bf23ae (diff) |
Do tidy up on disconnection.
Only clear IO related stuff if this free() was triggered deliberatly (i.e. not by server side disconnect)
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2411 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/modules/rtp/rtsp_client.c')
-rw-r--r-- | src/modules/rtp/rtsp_client.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/modules/rtp/rtsp_client.c b/src/modules/rtp/rtsp_client.c index 24839729..f9fe9bfe 100644 --- a/src/modules/rtp/rtsp_client.c +++ b/src/modules/rtp/rtsp_client.c @@ -151,6 +151,10 @@ void pa_rtsp_client_free(pa_rtsp_client* c) { if (c) { if (c->sc) pa_socket_client_unref(c->sc); + if (c->ioline) + pa_ioline_close(c->ioline); + else if (c->io) + pa_iochannel_free(c->io); pa_xfree(c->url); pa_xfree(c->localip); @@ -227,6 +231,10 @@ static void line_callback(pa_ioline *line, const char *s, void *userdata) { pa_assert(c->callback); if (!s) { + /* Keep the ioline/iochannel open as they will be freed automatically */ + c->ioline = NULL; + c->io = NULL; + pa_rtsp_client_free(c); c->callback(c, STATE_DISCONNECTED, NULL, c->userdata); return; } |