From a766109d1ec219ba8535a714a8061054eb24500f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Tue, 18 Apr 2023 19:12:17 +0200 Subject: accounts-manager: Cancel account manager requests on new user There's no point to continue a request if we've already queued another one. --- src/im-accounts-service.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/im-accounts-service.c b/src/im-accounts-service.c index 98e827e..1070e1d 100644 --- a/src/im-accounts-service.c +++ b/src/im-accounts-service.c @@ -104,6 +104,10 @@ user_changed (ActUserManager * manager, ActUser * user, gpointer user_data) /* Clear old proxies */ g_clear_object(&priv->touch_settings); + g_cancellable_cancel(priv->cancel); + g_clear_object(&priv->cancel); + priv->cancel = g_cancellable_new(); + /* Start getting a new proxy */ g_dbus_proxy_new_for_bus(G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, @@ -124,7 +128,10 @@ security_privacy_ready (GObject * obj, GAsyncResult * res, gpointer user_data) GDBusProxy * proxy = g_dbus_proxy_new_for_bus_finish(res, &error); if (error != NULL) { - g_warning("Unable to get a proxy on accounts service for touch settings: %s", error->message); + if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { + g_warning("Unable to get a proxy on accounts service for touch settings: %s", + error->message); + } g_error_free(error); return; } -- cgit v1.2.3