aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-08-16 12:42:41 -0500
committerTed Gould <ted@gould.cx>2010-08-16 12:42:41 -0500
commitfb1811ef2421e512b49bc5bb5c2796ba669ca29f (patch)
treee49dc38d39c44b946d13653f7a93935d07a49c79 /src
parent93f92e8e6a6bda708d227f3ebe9c8dae15694b9e (diff)
downloadlibayatana-appindicator-fb1811ef2421e512b49bc5bb5c2796ba669ca29f.tar.gz
libayatana-appindicator-fb1811ef2421e512b49bc5bb5c2796ba669ca29f.tar.bz2
libayatana-appindicator-fb1811ef2421e512b49bc5bb5c2796ba669ca29f.zip
Making it so that we don't set the proxy to null right away.
Diffstat (limited to 'src')
-rw-r--r--src/application-service-appstore.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c
index 85d72f7..9f1920d 100644
--- a/src/application-service-appstore.c
+++ b/src/application-service-appstore.c
@@ -75,6 +75,7 @@ typedef enum {
typedef struct _Approver Approver;
struct _Approver {
DBusGProxy * proxy;
+ gboolean destroy_by_proxy;
};
typedef struct _Application Application;
@@ -1076,7 +1077,9 @@ approver_free (gpointer papprover, gpointer user_data)
g_list_foreach(appstore->priv->applications, remove_approver, approver->proxy);
if (approver->proxy != NULL) {
- g_object_unref(approver->proxy);
+ if (!approver->destroy_by_proxy) {
+ g_object_unref(approver->proxy);
+ }
approver->proxy = NULL;
}
@@ -1153,7 +1156,7 @@ approver_destroyed (gpointer pproxy, gpointer pappstore)
}
Approver * approver = (Approver *)lapprover->data;
- approver->proxy = NULL;
+ approver->destroy_by_proxy = TRUE;
appstore->priv->approvers = g_list_remove(appstore->priv->approvers, approver);
approver_free(approver, appstore);
@@ -1171,6 +1174,7 @@ application_service_appstore_approver_add (ApplicationServiceAppstore * appstore
ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE (appstore);
Approver * approver = g_new0(Approver, 1);
+ approver->destroy_by_proxy = FALSE;
GError * error = NULL;
approver->proxy = dbus_g_proxy_new_for_name_owner(priv->bus,