rtsp-client: do not destroy the rtsp watch
authorPatricia Muscalu <patricia@axis.com>
Mon, 1 Oct 2012 14:13:50 +0000 (16:13 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Fri, 5 Oct 2012 09:44:32 +0000 (11:44 +0200)
Don't destroy the client watch while dispatching.  The rtsp watch is
automatically destroyed after the rtsp watch function closed() has
been called.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=685220

gst/rtsp-server/rtsp-client.c

index 81b5bd8..3e30084 100644 (file)
@@ -202,6 +202,9 @@ gst_rtsp_client_finalize (GObject * obj)
 
   GST_INFO ("finalize client %p", client);
 
+  if (client->watchid)
+    g_source_destroy ((GSource *) client->watch);
+
   client_cleanup_sessions (client);
 
   gst_rtsp_connection_free (client->connection);
@@ -536,11 +539,6 @@ close_connection (GstRTSPClient * client)
   }
 
   gst_rtsp_connection_close (client->connection);
-  if (client->watchid) {
-    g_source_destroy ((GSource *) client->watch);
-    client->watchid = 0;
-    client->watch = NULL;
-  }
 }
 
 static gboolean
@@ -1942,11 +1940,6 @@ tunnel_complete (GstRTSPWatch * watch, gpointer user_data)
   gst_rtsp_watch_reset (oclient->watch);
   g_object_unref (oclient);
 
-  /* we don't need this watch anymore */
-  g_source_destroy ((GSource *) client->watch);
-  client->watchid = 0;
-  client->watch = NULL;
-
   return GST_RTSP_OK;
 
   /* ERRORS */