diff options
author | Ted Gould <ted@gould.cx> | 2011-04-12 15:30:54 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-04-12 15:30:54 -0500 |
commit | 8589bf9e62970dfbd5820ff996d12b37c166df99 (patch) | |
tree | b6fb1d0abd84a484d4df44bfd0dcfe076562ae5b /src | |
parent | a59579925a0ed5bf67d8dcccc9adde479097015d (diff) | |
parent | 0edabc65075851f47d28247a8eb863d2afdfb051 (diff) | |
download | ayatana-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)
Diffstat (limited to 'src')
-rw-r--r-- | src/application-service-appstore.c | 6 |
1 files changed, 6 insertions, 0 deletions
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; |