aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/application-service-appstore.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c
index 9d35d66..d2678fd 100644
--- a/src/application-service-appstore.c
+++ b/src/application-service-appstore.c
@@ -499,7 +499,8 @@ got_all_properties (GObject * source_object, GAsyncResult * res,
if (menu == NULL || id == NULL || category == NULL || status == NULL ||
icon_name == NULL) {
g_warning("Notification Item on object %s of %s doesn't have enough properties.", app->dbus_object, app->dbus_name);
- g_free(app); // Need to do more than this, but it gives the idea of the flow we're going for.
+ if (!app->validated)
+ application_free(app);
}
else {
app->validated = TRUE;
@@ -577,6 +578,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,
@@ -1117,6 +1119,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;