client: free watch context only once
authorWim Taymans <wtaymans@redhat.com>
Tue, 1 Jul 2014 14:12:13 +0000 (16:12 +0200)
committerWim Taymans <wtaymans@redhat.com>
Tue, 1 Jul 2014 14:12:13 +0000 (16:12 +0200)
The watch context is freed when the source is destroyed. Avoids
a CRITICAL when we try to unref the context twice.

gst/rtsp-server/rtsp-client.c

index 57865f2..c60ba0a 100644 (file)
@@ -3263,8 +3263,6 @@ handle_tunnel (GstRTSPClient * client)
     /* the old client owns the tunnel now, the new one will be freed */
     g_source_destroy ((GSource *) priv->watch);
     priv->watch = NULL;
-    g_main_context_unref (priv->watch_context);
-    priv->watch_context = NULL;
     gst_rtsp_client_set_send_func (client, NULL, NULL, NULL);
   }
 
@@ -3393,7 +3391,7 @@ gst_rtsp_client_attach (GstRTSPClient * client, GMainContext * context)
    * be superceeded by a cache object later */
   gst_rtsp_watch_set_send_backlog (priv->watch, 0, 100);
 
-  GST_INFO ("attaching to context %p", context);
+  GST_INFO ("client %p: attaching to context %p", client, context);
   res = gst_rtsp_watch_attach (priv->watch, context);
 
   return res;