From 12aab9617cef451183373e16b70a7a168aa82114 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 8 Jan 2010 12:34:43 -0600 Subject: When destroying the application free all the proxies. --- src/application-service-appstore.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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; -- cgit v1.2.3