aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-debug-window.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-12-01 00:03:58 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-12-01 00:03:58 +0800
commit6e1756e9eafd1fb88c0e09fbb80a31185c6c13ff (patch)
tree4dd91ed383d081b32048b1ab2bc3477eab3e89a7 /src/empathy-debug-window.c
parent740a34efd932ad1bf6d5cd1d4580fd3b6af0eacc (diff)
downloadgsoc2013-empathy-6e1756e9eafd1fb88c0e09fbb80a31185c6c13ff.tar
gsoc2013-empathy-6e1756e9eafd1fb88c0e09fbb80a31185c6c13ff.tar.gz
gsoc2013-empathy-6e1756e9eafd1fb88c0e09fbb80a31185c6c13ff.tar.bz2
gsoc2013-empathy-6e1756e9eafd1fb88c0e09fbb80a31185c6c13ff.tar.lz
gsoc2013-empathy-6e1756e9eafd1fb88c0e09fbb80a31185c6c13ff.tar.xz
gsoc2013-empathy-6e1756e9eafd1fb88c0e09fbb80a31185c6c13ff.tar.zst
gsoc2013-empathy-6e1756e9eafd1fb88c0e09fbb80a31185c6c13ff.zip
debug-window: don't disconnect the new debug msg signal once the proxy has been invalidated
According to tp_proxy_signal_connection_disconnect's documentation it's not safe to disconnect a signal after its proxy has been invalidated (#603384).
Diffstat (limited to 'src/empathy-debug-window.c')
-rw-r--r--src/empathy-debug-window.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/empathy-debug-window.c b/src/empathy-debug-window.c
index 4c34e6808..e411fcd73 100644
--- a/src/empathy-debug-window.c
+++ b/src/empathy-debug-window.c
@@ -98,6 +98,7 @@ typedef struct
TpProxy *proxy;
TpProxySignalConnection *new_debug_message_signal;
TpProxySignalConnection *name_owner_changed_signal;
+ gulong invalid_signal_id;
/* Whether NewDebugMessage will be fired */
gboolean paused;
@@ -402,6 +403,19 @@ debug_window_add_log_messages_from_cache (EmpathyDebugWindow *debug_window,
}
static void
+proxy_invalidated_cb (TpProxy *proxy,
+ guint domain,
+ gint code,
+ gchar *msg,
+ EmpathyDebugWindowPriv *self)
+{
+ EmpathyDebugWindowPriv *priv = GET_PRIV (self);
+
+ /* Proxy has been invalidated so we can't disconnect the signal any more */
+ priv->new_debug_message_signal = NULL;
+}
+
+static void
debug_window_cm_chooser_changed_cb (GtkComboBox *cm_chooser,
EmpathyDebugWindow *debug_window)
{
@@ -466,7 +480,10 @@ debug_window_cm_chooser_changed_cb (GtkComboBox *cm_chooser,
}
if (priv->proxy != NULL)
- g_object_unref (priv->proxy);
+ {
+ g_signal_handler_disconnect (priv->proxy, priv->invalid_signal_id);
+ g_object_unref (priv->proxy);
+ }
priv->proxy = proxy;
@@ -475,6 +492,9 @@ debug_window_cm_chooser_changed_cb (GtkComboBox *cm_chooser,
emp_cli_debug_call_get_messages (priv->proxy, -1,
debug_window_get_messages_cb, debug_window, NULL, NULL);
+ priv->invalid_signal_id = g_signal_connect (proxy, "invalidated",
+ G_CALLBACK (proxy_invalidated_cb), debug_window);
+
g_object_unref (dbus);
}
@@ -1460,6 +1480,7 @@ debug_window_dispose (GObject *object)
if (priv->proxy != NULL)
{
debug_window_set_enabled (EMPATHY_DEBUG_WINDOW (object), FALSE);
+ g_signal_handler_disconnect (priv->proxy, priv->invalid_signal_id);
g_object_unref (priv->proxy);
}