mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-09 19:06:15 +01:00
fdo notification: Avoid a double free
We're first getting the notification by its notify_id, but activating the action afterwards could redraw it, leading to a dangling pointer. Fix this by simply searching the list of active notifications again after activating the action.
This commit is contained in:
parent
d0ffee8feb
commit
1920b550db
@ -178,8 +178,13 @@ notify_signal (GDBusConnection *connection,
|
||||
}
|
||||
}
|
||||
|
||||
backend->notifications = g_slist_remove (backend->notifications, n);
|
||||
freedesktop_notification_free (n);
|
||||
/* Get the notification again in case the action redrew it */
|
||||
n = g_fdo_notification_backend_find_notification_by_notify_id (backend, id);
|
||||
if (n != NULL)
|
||||
{
|
||||
backend->notifications = g_slist_remove (backend->notifications, n);
|
||||
freedesktop_notification_free (n);
|
||||
}
|
||||
}
|
||||
|
||||
/* Converts a GNotificationPriority to an urgency level as defined by
|
||||
|
Loading…
Reference in New Issue
Block a user