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
case STATE_DISCONNECTED:
pa_assert(c->closed_callback);
pa_log_debug("RTSP channel closed");
+ c->rtsp = NULL;
if (c->fd > 0) {
pa_close(c->fd);
c->fd = -1;
pa_assert(c);
pa_xfree(c->buffer);
- pa_rtsp_client_free(c->rtsp);
+ if (c->rtsp)
+ pa_rtsp_client_free(c->rtsp);
pa_xfree(c->host);
pa_xfree(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);
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;
}