@samitouri / QOSamiQemu / commits / e1fa7f123f

util: make notifer_remove() safer

Allow to call multiple time notifier_remove() safely. This shoudn't impact performance in any measurable way... Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20260623-b4-ui-v4-8-4656aec3398d@redhat.com>

Marc-André Lureau committed Jun 23, 2026 at 11:44 UTC e1fa7f123f2535f823a0a179c28569d693babdf6
1 file changed +1 -1
util/notify.c
+1 -1
@@ -28,7 +28,7 @@ void notifier_list_add(NotifierList *list, Notifier *notifier)
28
29 void notifier_remove(Notifier *notifier)
30 {
31 - QLIST_REMOVE(notifier, node);
31 + QLIST_SAFE_REMOVE(notifier, node);
32 }
33
34 void notifier_list_notify(NotifierList *list, void *data)