[gnome-flashback] libstatus-notifier: handle cancellation correctly
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-flashback] libstatus-notifier: handle cancellation correctly
- Date: Sun, 13 Nov 2016 22:31:18 +0000 (UTC)
commit 76bc1dd9fc4803d59d0d281cd63995d13bd45a1a
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Mon Nov 14 00:13:12 2016 +0200
libstatus-notifier: handle cancellation correctly
libstatus-notifier/sn-dbus-item-server-v0.c | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/libstatus-notifier/sn-dbus-item-server-v0.c b/libstatus-notifier/sn-dbus-item-server-v0.c
index ebade03..04c57d5 100644
--- a/libstatus-notifier/sn-dbus-item-server-v0.c
+++ b/libstatus-notifier/sn-dbus-item-server-v0.c
@@ -171,18 +171,25 @@ proxy_ready_cb (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
- SnDBusItemServerV0 *server;
GError *error;
+ SnWatcherV0Gen *watcher;
+ SnDBusItemServerV0 *server;
- server = SN_DBUS_ITEM_SERVER_V0 (user_data);
error = NULL;
+ watcher = sn_watcher_v0_gen_proxy_new_finish (res, &error);
+
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ {
+ g_error_free (error);
+ return;
+ }
- server->watcher = sn_watcher_v0_gen_proxy_new_finish (res, &error);
+ server = SN_DBUS_ITEM_SERVER_V0 (user_data);
+ server->watcher = watcher;
if (error)
{
- if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
- sn_dbus_item_emit_error (SN_DBUS_ITEM (server), error);
+ sn_dbus_item_emit_error (SN_DBUS_ITEM (server), error);
g_error_free (error);
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]