client: free watch context only once

The watch context is freed when the source is destroyed. Avoids
a CRITICAL when we try to unref the context twice.
This commit is contained in:
Wim Taymans 2014-07-01 16:12:13 +02:00
parent 517bb78ae3
commit 72a57e792f

View 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;