aboutsummaryrefslogtreecommitdiff
path: root/libindicate/server.c
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-04-07 17:40:25 -0500
committerTed Gould <ted@canonical.com>2009-04-07 17:40:25 -0500
commit3e1e51261167c74fa81819cebaafce944e14b310 (patch)
tree2351bda4d3eee618da87dfc678bdb17ad6231a04 /libindicate/server.c
parent596a5dbe3fce033ed7465b514d49c4485884bc02 (diff)
downloadlibayatana-indicator-3e1e51261167c74fa81819cebaafce944e14b310.tar.gz
libayatana-indicator-3e1e51261167c74fa81819cebaafce944e14b310.tar.bz2
libayatana-indicator-3e1e51261167c74fa81819cebaafce944e14b310.zip
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.
Diffstat (limited to 'libindicate/server.c')
-rw-r--r--libindicate/server.c12
1 files 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);