Michael Catanzaro 12a10e3
From e07685ff5e93346a86690fcf1b8449bf934c8da4 Mon Sep 17 00:00:00 2001
Michael Catanzaro 12a10e3
From: Fabrice Bellet <fabrice@bellet.info>
Michael Catanzaro 12a10e3
Date: Wed, 13 Jul 2016 16:00:05 +0200
Michael Catanzaro 12a10e3
Subject: [PATCH] call-window: properly remove the fs element notifiers
Michael Catanzaro 12a10e3
Michael Catanzaro 12a10e3
This patch removes the FsElementAddedNotifier from the pipeline
Michael Catanzaro 12a10e3
in the conference remove callback, instead of just unreferencing
Michael Catanzaro 12a10e3
them. This fixes a crash in the rtp-special-source stop thread
Michael Catanzaro 12a10e3
cleanup code.
Michael Catanzaro 12a10e3
Michael Catanzaro 12a10e3
https://bugzilla.gnome.org/show_bug.cgi?id=768889
Michael Catanzaro 12a10e3
---
Michael Catanzaro 12a10e3
 src/empathy-call-window.c | 19 ++++++++++++++++---
Michael Catanzaro 12a10e3
 1 file changed, 16 insertions(+), 3 deletions(-)
Michael Catanzaro 12a10e3
Michael Catanzaro 12a10e3
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
Michael Catanzaro 12a10e3
index a54346c..2bbbd0f 100644
Michael Catanzaro 12a10e3
--- a/src/empathy-call-window.c
Michael Catanzaro 12a10e3
+++ b/src/empathy-call-window.c
Michael Catanzaro 12a10e3
@@ -2513,17 +2513,30 @@ empathy_call_window_conference_added_cb (EmpathyCallHandler *handler,
Michael Catanzaro 12a10e3
 }
Michael Catanzaro 12a10e3
 
Michael Catanzaro 12a10e3
 static void
Michael Catanzaro 12a10e3
+empathy_call_window_add_notifier_remove (gpointer data, gpointer user_data)
Michael Catanzaro 12a10e3
+{
Michael Catanzaro 12a10e3
+  EmpathyCallWindow *self = EMPATHY_CALL_WINDOW (user_data);
Michael Catanzaro 12a10e3
+  EmpathyCallWindowPriv *priv = GET_PRIV (self);
Michael Catanzaro 12a10e3
+  FsElementAddedNotifier *notifier = data;
Michael Catanzaro 12a10e3
+
Michael Catanzaro 12a10e3
+  fs_element_added_notifier_remove (notifier, GST_BIN (priv->pipeline));
Michael Catanzaro 12a10e3
+}
Michael Catanzaro 12a10e3
+
Michael Catanzaro 12a10e3
+static void
Michael Catanzaro 12a10e3
 empathy_call_window_conference_removed_cb (EmpathyCallHandler *handler,
Michael Catanzaro 12a10e3
   GstElement *conference, gpointer user_data)
Michael Catanzaro 12a10e3
 {
Michael Catanzaro 12a10e3
   EmpathyCallWindow *self = EMPATHY_CALL_WINDOW (user_data);
Michael Catanzaro 12a10e3
   EmpathyCallWindowPriv *priv = GET_PRIV (self);
Michael Catanzaro 12a10e3
 
Michael Catanzaro 12a10e3
-  g_list_free_full (priv->notifiers, g_object_unref);
Michael Catanzaro 12a10e3
-  priv->notifiers = NULL;
Michael Catanzaro 12a10e3
-
Michael Catanzaro 12a10e3
   gst_bin_remove (GST_BIN (priv->pipeline), conference);
Michael Catanzaro 12a10e3
   gst_element_set_state (conference, GST_STATE_NULL);
Michael Catanzaro 12a10e3
+
Michael Catanzaro 12a10e3
+  g_list_foreach (priv->notifiers,
Michael Catanzaro 12a10e3
+    empathy_call_window_add_notifier_remove, user_data);
Michael Catanzaro 12a10e3
+
Michael Catanzaro 12a10e3
+  g_list_free_full (priv->notifiers, g_object_unref);
Michael Catanzaro 12a10e3
+  priv->notifiers = NULL;
Michael Catanzaro 12a10e3
 }
Michael Catanzaro 12a10e3
 
Michael Catanzaro 12a10e3
 static gboolean