rtspconnection: call watch notify before freeing any watch resources
authorAleix Conchillo FlaquƩ <aleix@oblong.com>
Wed, 1 Oct 2014 22:04:09 +0000 (15:04 -0700)
committerWim Taymans <wtaymans@redhat.com>
Tue, 21 Oct 2014 08:03:35 +0000 (10:03 +0200)
This gives control to the notify function allowing it to finish other
watch related functionality.

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

gst-libs/gst/rtsp/gstrtspconnection.c

index 559b989..23ba516 100644 (file)
@@ -3395,6 +3395,9 @@ gst_rtsp_source_finalize (GSource * source)
 {
   GstRTSPWatch *watch = (GstRTSPWatch *) source;
 
+  if (watch->notify)
+    watch->notify (watch->user_data);
+
   build_reset (&watch->builder);
   gst_rtsp_message_unset (&watch->message);
 
@@ -3414,9 +3417,6 @@ gst_rtsp_source_finalize (GSource * source)
     g_source_unref (watch->controlsrc);
 
   g_mutex_clear (&watch->mutex);
-
-  if (watch->notify)
-    watch->notify (watch->user_data);
 }
 
 static GSourceFuncs gst_rtsp_source_funcs = {