diff options
author | Arnaud Rebillout <elboulangero@gmail.com> | 2018-06-14 11:21:11 +0700 |
---|---|---|
committer | Arnaud Rebillout <elboulangero@gmail.com> | 2018-06-14 11:28:17 +0700 |
commit | 5a73eef7498bacce9b5b176a927af8ad20d2947e (patch) | |
tree | 95c1a223ee6b1fe369ec4c380baa0cbe9067b535 | |
parent | c26558c1b1391f32f208a48a47fa7a714f2b7529 (diff) | |
download | glib-5a73eef7498bacce9b5b176a927af8ad20d2947e.tar.gz |
gfdonotificationbackend: hold a strong ref on backend
This is to avoid race between dispose() being called on the
GFdoNotificationBackend instance, and any pending operations which are
still waiting on a D-Bus reply when it’s disposed.
(thx to Philip Withnall for pointing that out)
Signed-off-by: Arnaud Rebillout <elboulangero@gmail.com>
-rw-r--r-- | gio/gfdonotificationbackend.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gio/gfdonotificationbackend.c b/gio/gfdonotificationbackend.c index ab5329497..c4fa0dc1d 100644 --- a/gio/gfdonotificationbackend.c +++ b/gio/gfdonotificationbackend.c @@ -67,6 +67,7 @@ freedesktop_notification_free (gpointer data) { FreedesktopNotification *n = data; + g_object_unref (n->backend); g_free (n->id); g_free (n->default_action); if (n->default_action_target) @@ -83,7 +84,7 @@ freedesktop_notification_new (GFdoNotificationBackend *backend, FreedesktopNotification *n; n = g_slice_new0 (FreedesktopNotification); - n->backend = backend; + n->backend = g_object_ref (backend); n->id = g_strdup (id); n->notify_id = 0; g_notification_get_default_action (notification, |