rtspconnection: No remove child if destroyed.
authorGöran Jönsson <goranjn@axis.com>
Tue, 25 Nov 2014 12:31:48 +0000 (13:31 +0100)
committerWim Taymans <wtaymans@redhat.com>
Tue, 9 Dec 2014 09:32:00 +0000 (10:32 +0100)
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=740730

gst-libs/gst/rtsp/gstrtspconnection.c

index dd4986f..50c0f8c 100644 (file)
@@ -3142,7 +3142,8 @@ gst_rtsp_source_dispatch_read (GPollableInputStream * stream,
   else if (G_UNLIKELY (res == GST_RTSP_EEOF)) {
     g_mutex_lock (&watch->mutex);
     if (watch->readsrc) {
-      g_source_remove_child_source ((GSource *) watch, watch->readsrc);
+      if (!g_source_is_destroyed ((GSource *) watch))
+        g_source_remove_child_source ((GSource *) watch, watch->readsrc);
       g_source_unref (watch->readsrc);
       watch->readsrc = NULL;
     }
@@ -3305,7 +3306,8 @@ gst_rtsp_source_dispatch_write (GPollableOutputStream * stream,
       rec = g_queue_pop_tail (watch->messages);
       if (rec == NULL) {
         if (watch->writesrc) {
-          g_source_remove_child_source ((GSource *) watch, watch->writesrc);
+          if (!g_source_is_destroyed ((GSource *) watch))
+            g_source_remove_child_source ((GSource *) watch, watch->writesrc);
           g_source_unref (watch->writesrc);
           watch->writesrc = NULL;
           /* we create and add the write source again when we actually have