aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-01-08 12:34:43 -0600
committerTed Gould <ted@gould.cx>2010-01-08 12:34:43 -0600
commit12aab9617cef451183373e16b70a7a168aa82114 (patch)
tree3e448872827f96f9d045357974c9a70664874204 /src
parentad42e1044d1bc653a3df8ce76e6e74d79ea890cc (diff)
downloadayatana-indicator-application-12aab9617cef451183373e16b70a7a168aa82114.tar.gz
ayatana-indicator-application-12aab9617cef451183373e16b70a7a168aa82114.tar.bz2
ayatana-indicator-application-12aab9617cef451183373e16b70a7a168aa82114.zip
When destroying the application free all the proxies.
Diffstat (limited to 'src')
-rw-r--r--src/application-service-appstore.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c
index 3215b49..de8d914 100644
--- a/src/application-service-appstore.c
+++ b/src/application-service-appstore.c
@@ -78,6 +78,7 @@ struct _Application {
gchar * aicon;
gchar * menu;
gchar * icon_path;
+ gboolean currently_free;
};
#define APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(o) \
@@ -261,6 +262,18 @@ static void
application_free (Application * app)
{
if (app == NULL) return;
+
+ /* Handle the case where this could be called by unref'ing one of
+ the proxy objects. */
+ if (app->currently_free) return;
+ app->currently_free = TRUE;
+
+ if (app->dbus_proxy) {
+ g_object_unref(app->dbus_proxy);
+ }
+ if (app->prop_proxy) {
+ g_object_unref(app->prop_proxy);
+ }
if (app->dbus_name != NULL) {
g_free(app->dbus_name);
@@ -512,6 +525,7 @@ application_service_appstore_application_add (ApplicationServiceAppstore * appst
app->aicon = NULL;
app->menu = NULL;
app->icon_path = NULL;
+ app->currently_free = FALSE;
/* Get the DBus proxy for the NotificationItem interface */
GError * error = NULL;