Commit ebafccb6 authored by Edward Hervey's avatar Edward Hervey 🤘 Committed by Edward Hervey

rtsp-client: Remove timeout GSource on cleanup

Avoids ending up with races where a timeout would still be around
*after* a client was gone. This could happen rather easily in
RTSP-over-HTTP mode on a local connection, where each RTSP message
would be sent as a different HTTP connection with the same tunnelid.

If not properly removed, that timeout would then try to free again
a client (and its contents).
parent 22ced50d
......@@ -782,6 +782,14 @@ gst_rtsp_client_finalize (GObject * obj)
clean_cached_media (client, TRUE);
if (priv->rtsp_ctrl_timeout_id != 0) {
GST_DEBUG ("Killing leftover timeout GSource for client %p", client);
g_source_destroy (g_main_context_find_source_by_id (priv->watch_context,
priv->rtsp_ctrl_timeout_id = 0;
priv->rtsp_ctrl_timeout_cnt = 0;
g_free (priv->server_ip);
g_mutex_clear (&priv->lock);
g_mutex_clear (&priv->send_lock);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment