aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-04-12 15:30:54 -0500
committerTed Gould <ted@gould.cx>2011-04-12 15:30:54 -0500
commit8589bf9e62970dfbd5820ff996d12b37c166df99 (patch)
treeb6fb1d0abd84a484d4df44bfd0dcfe076562ae5b
parenta59579925a0ed5bf67d8dcccc9adde479097015d (diff)
parent0edabc65075851f47d28247a8eb863d2afdfb051 (diff)
downloadayatana-indicator-application-8589bf9e62970dfbd5820ff996d12b37c166df99.tar.gz
ayatana-indicator-application-8589bf9e62970dfbd5820ff996d12b37c166df99.tar.bz2
ayatana-indicator-application-8589bf9e62970dfbd5820ff996d12b37c166df99.zip
* Protect against cancelation
* Make it so that we can cancel GetAll() (LP: #725665)
-rw-r--r--debian/changelog4
-rw-r--r--src/application-service-appstore.c6
2 files changed, 9 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index b666087..e14015b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,9 +3,11 @@ indicator-application (0.3.1-0ubuntu3~ppa1) UNRELEASED; urgency=low
* Upstream Merge
* Free app using application_free() instead of just freeing the
memory (LP: #743564)
+ * Protect against cancelation
+ * Make it so that we can cancel GetAll() (LP: #725665)
* Drop debian/patches/lp_743564.patch as merged upstream.
- -- Ted Gould <ted@ubuntu.com> Tue, 12 Apr 2011 15:17:33 -0500
+ -- Ted Gould <ted@ubuntu.com> Tue, 12 Apr 2011 15:30:03 -0500
indicator-application (0.3.1-0ubuntu2) natty; urgency=low
diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c
index 4cafdfc..b8a429a 100644
--- a/src/application-service-appstore.c
+++ b/src/application-service-appstore.c
@@ -577,6 +577,7 @@ static void
get_all_properties (Application * app)
{
if (app->props != NULL && app->props_cancel == NULL) {
+ app->props_cancel = g_cancellable_new();
g_dbus_proxy_call(app->props, "GetAll",
g_variant_new("(s)", NOTIFICATION_ITEM_DBUS_IFACE),
G_DBUS_CALL_FLAGS_NONE, -1, app->props_cancel,
@@ -1111,6 +1112,11 @@ props_cb (GObject * object, GAsyncResult * res, gpointer user_data)
GDBusProxy * proxy = g_dbus_proxy_new_for_bus_finish(res, &error);
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+ g_error_free (error);
+ return; // Must exit before accessing freed memory
+ }
+
if (app->props_cancel != NULL) {
g_object_unref(app->props_cancel);
app->props_cancel = NULL;