[glib/wip/gnotification] fdo backend: don't crash when default action is unset
- From: Lars Uebernickel <larsu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/gnotification] fdo backend: don't crash when default action is unset
- Date: Mon, 21 Oct 2013 16:33:25 +0000 (UTC)
commit 6f8c5e18819473e305ab9011b54bb892fc0712e2
Author: Lars Uebernickel <lars uebernic de>
Date: Mon Oct 21 12:30:43 2013 -0400
fdo backend: don't crash when default action is unset
gio/gfdonotificationbackend.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/gio/gfdonotificationbackend.c b/gio/gfdonotificationbackend.c
index e6f026b..ad665be 100644
--- a/gio/gfdonotificationbackend.c
+++ b/gio/gfdonotificationbackend.c
@@ -339,7 +339,7 @@ g_fdo_notification_backend_send_notification (GNotificationBackend *backend,
n = g_fdo_notification_backend_find_notification (self, id);
if (n == NULL)
{
- n = g_slice_new (FreedesktopNotification);
+ n = g_slice_new0 (FreedesktopNotification);
n->backend = self;
n->id = g_strdup (id);
n->notify_id = 0;
@@ -349,9 +349,8 @@ g_fdo_notification_backend_send_notification (GNotificationBackend *backend,
else
{
/* Only clear default action. All other fields are still valid */
- g_free (n->default_action);
- if (n->default_action_target)
- g_variant_unref (n->default_action_target);
+ g_clear_pointer (&n->default_action, g_free);
+ g_clear_pointer (&n->default_action_target, g_variant_unref);
}
g_notification_get_default_action (notification, &n->default_action, &n->default_action_target);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]