diff options
author | Ted Gould <ted@gould.cx> | 2010-12-08 10:11:30 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-12-08 10:11:30 -0600 |
commit | 7fae05b11eea1644bf0a0a7e773c7753a9b620d8 (patch) | |
tree | f4ec35a9ae1dbbe84d9bca2a5ed544c7551a7a45 /src | |
parent | 52375e6f27d268b13227b1f51b6a126e4df3a435 (diff) | |
download | libayatana-appindicator-7fae05b11eea1644bf0a0a7e773c7753a9b620d8.tar.gz libayatana-appindicator-7fae05b11eea1644bf0a0a7e773c7753a9b620d8.tar.bz2 libayatana-appindicator-7fae05b11eea1644bf0a0a7e773c7753a9b620d8.zip |
Making sure we have more ref's on our callbacks.
Diffstat (limited to 'src')
-rw-r--r-- | src/app-indicator.c | 13 |
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; } |