aboutsummaryrefslogtreecommitdiff
path: root/src/app-indicator.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/app-indicator.c')
-rw-r--r--src/app-indicator.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/app-indicator.c b/src/app-indicator.c
index 744590b..2b45b85 100644
--- a/src/app-indicator.c
+++ b/src/app-indicator.c
@@ -887,6 +887,7 @@ bus_creation (GObject * obj, GAsyncResult * res, gpointer user_data)
if (error != NULL) {
g_warning("Unable to get the session bus: %s", error->message);
g_error_free(error);
+ g_object_unref(G_OBJECT(user_data));
return;
}
@@ -1091,6 +1092,8 @@ bus_watcher_ready (GObject * obj, GAsyncResult * res, gpointer user_data)
if (IS_APP_INDICATOR(user_data)) {
start_fallback_timer(APP_INDICATOR(user_data), FALSE);
}
+
+ g_object_unref(G_OBJECT(user_data));
return;
}
@@ -1109,9 +1112,15 @@ bus_watcher_ready (GObject * obj, GAsyncResult * res, gpointer user_data)
gchar * name = g_dbus_proxy_get_name_owner(app->priv->watcher_proxy);
if (name == NULL) {
start_fallback_timer(APP_INDICATOR(user_data), FALSE);
+ g_object_unref(G_OBJECT(user_data));
return;
}
+ /* g_object_unref(G_OBJECT(user_data)); */
+ /* Why is this commented out? Oh, wait, we don't want to
+ unref in this case because we need to ref again to do the
+ register callback. Let's not unref to ref again. */
+
g_dbus_proxy_call(app->priv->watcher_proxy,
"RegisterStatusNotifierItem",
g_variant_new("(s)", app->priv->path),
@@ -1121,8 +1130,6 @@ bus_watcher_ready (GObject * obj, GAsyncResult * res, gpointer user_data)
register_service_cb,
user_data);
- g_object_unref(G_OBJECT(user_data));
-
return;
}
@@ -1173,6 +1180,7 @@ register_service_cb (GObject * obj, GAsyncResult * res, gpointer user_data)
be doing */
g_warning("Unable to connect to the Notification Watcher: %s", error->message);
start_fallback_timer(APP_INDICATOR(user_data), TRUE);
+ g_object_unref(G_OBJECT(user_data));
return;
}
@@ -1191,6 +1199,7 @@ register_service_cb (GObject * obj, GAsyncResult * res, gpointer user_data)
}
}
+ g_object_unref(G_OBJECT(user_data));
return;
}