rtsp-client: Use watch_context before unref

Move the usage of priv->watch_context to beginning of function
gst_rtsp_client_finalize. Instead of use it after
g_main_context_unref (priv->watch_context).
This commit is contained in:
Göran Jönsson 2020-03-09 14:17:34 +01:00
parent 8410c69da9
commit daa18dc867

View file

@ -763,6 +763,14 @@ gst_rtsp_client_finalize (GObject * obj)
GST_INFO ("finalize client %p", client);
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));
priv->rtsp_ctrl_timeout_id = 0;
priv->rtsp_ctrl_timeout_cnt = 0;
}
if (priv->watch)
gst_rtsp_watch_set_flushing (priv->watch, TRUE);
gst_rtsp_client_set_send_func (client, NULL, NULL, NULL);
@ -798,14 +806,6 @@ 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));
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);