From c892f84845aeb7367c9246a679a21da09ebafd2c Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 11 Mar 2011 15:49:21 -0600 Subject: Only clear the cancel if we're not being cancelled --- src/indicator-application.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/indicator-application.c b/src/indicator-application.c index c2dd16a..f9b200b 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -823,14 +823,16 @@ get_applications (GObject * obj, GAsyncResult * res, gpointer user_data) GVariant * child; GVariantIter * iter; + result = g_dbus_proxy_call_finish(priv->service_proxy, res, &error); + /* No one can cancel us anymore, we've completed! */ if (priv->get_apps_cancel != NULL) { - g_object_unref(priv->get_apps_cancel); - priv->get_apps_cancel = NULL; + if (error == NULL || error->domain != G_IO_ERROR || error->code != G_IO_ERROR_CANCELLED) { + g_object_unref(priv->get_apps_cancel); + priv->get_apps_cancel = NULL; + } } - result = g_dbus_proxy_call_finish(priv->service_proxy, res, &error); - if (error != NULL) { g_warning("Unable to get application list: %s", error->message); return; -- cgit v1.2.3