From 3e1e51261167c74fa81819cebaafce944e14b310 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 7 Apr 2009 17:40:25 -0500 Subject: Making it so that we don't register the object twice. This is really a work around, but it's atleast fixes the crasher. Which sucked. We need to work with the dbus folks to make this better. --- libindicate/server.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libindicate/server.c b/libindicate/server.c index ed81d54..1be8ee5 100644 --- a/libindicate/server.c +++ b/libindicate/server.c @@ -84,6 +84,7 @@ struct _IndicateServerPrivate GSList * indicators; gboolean visible; guint current_id; + gboolean registered; gchar * desktop; gchar * type; @@ -260,6 +261,7 @@ indicate_server_init (IndicateServer * server) priv->indicators = NULL; priv->num_hidden = 0; priv->visible = FALSE; + priv->registered = FALSE; priv->current_id = 0; priv->type = NULL; priv->desktop = NULL; @@ -371,9 +373,13 @@ indicate_server_show (IndicateServer * server) priv->connection = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); - dbus_g_connection_register_g_object(priv->connection, - priv->path, - G_OBJECT(server)); + if (!priv->registered) { + dbus_g_connection_register_g_object(priv->connection, + priv->path, + G_OBJECT(server)); + priv->registered = TRUE; + } + priv->visible = TRUE; g_signal_emit(server, signals[SERVER_SHOW], 0, priv->type ? priv->type : "", TRUE); -- cgit v1.2.3