client: Destroy the rtsp watch after connection close
authorOgnyan Tonchev <ognyan@axis.com>
Thu, 12 Jun 2014 11:48:44 +0000 (13:48 +0200)
committerWim Taymans <wtaymans@redhat.com>
Wed, 18 Jun 2014 13:21:23 +0000 (15:21 +0200)
gst/rtsp-server/rtsp-client.c

index fb44a29..4a8214f 100644 (file)
@@ -795,6 +795,15 @@ close_connection (GstRTSPClient * client)
   }
 
   gst_rtsp_connection_close (priv->connection);
+
+  /* connection is now closed, destroy the watch which will also cause the
+   * closed signal to be emitted */
+  if (priv->watch) {
+    GST_DEBUG ("client %p: destroying watch", client);
+    g_source_destroy ((GSource *) priv->watch);
+    priv->watch = NULL;
+    gst_rtsp_client_set_send_func (client, NULL, NULL, NULL);
+  }
 }
 
 static gchar *