aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Terry <mike@mterry.name>2011-04-07 10:10:11 -0400
committerMichael Terry <mike@mterry.name>2011-04-07 10:10:11 -0400
commitf57f2e78ccd66ed1fc4dc83f74ee3bdc2ed510e7 (patch)
tree63c24d9ba6e5b81e21ffb6f4193ef58c63d542fd /src
parent2e52cac231a41f03dd881cf367189e0fce10902a (diff)
downloadayatana-indicator-application-f57f2e78ccd66ed1fc4dc83f74ee3bdc2ed510e7.tar.gz
ayatana-indicator-application-f57f2e78ccd66ed1fc4dc83f74ee3bdc2ed510e7.tar.bz2
ayatana-indicator-application-f57f2e78ccd66ed1fc4dc83f74ee3bdc2ed510e7.zip
cancel-guard several callback functions
Diffstat (limited to 'src')
-rw-r--r--src/application-service-appstore.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c
index 25eba69..3e827d5 100644
--- a/src/application-service-appstore.c
+++ b/src/application-service-appstore.c
@@ -432,7 +432,6 @@ got_all_properties (GObject * source_object, GAsyncResult * res,
g_return_if_fail(app != NULL);
GError * error = NULL;
- ApplicationServiceAppstorePrivate * priv = app->appstore->priv;
GVariant * menu = NULL, * id = NULL, * category = NULL,
* status = NULL, * icon_name = NULL, * aicon_name = NULL,
* icon_desc = NULL, * aicon_desc = NULL,
@@ -441,6 +440,11 @@ got_all_properties (GObject * source_object, GAsyncResult * res,
GVariant * properties = g_dbus_proxy_call_finish(G_DBUS_PROXY(source_object), 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;
@@ -454,6 +458,8 @@ got_all_properties (GObject * source_object, GAsyncResult * res,
return;
}
+ ApplicationServiceAppstorePrivate * priv = app->appstore->priv;
+
/* Grab all properties from variant */
GVariantIter * iter = NULL;
const gchar * name = NULL;
@@ -1043,6 +1049,11 @@ dbus_proxy_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->dbus_proxy_cancel != NULL) {
g_object_unref(app->dbus_proxy_cancel);
app->dbus_proxy_cancel = NULL;
@@ -1437,6 +1448,12 @@ approver_proxy_cb (GObject * object, GAsyncResult * res, gpointer user_data)
g_return_if_fail(approver != NULL);
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
+ }
+
ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE (approver->appstore);
if (approver->proxy_cancel != NULL) {