From 5d418284e4d9012d71b938196c3dc012710ef59b Mon Sep 17 00:00:00 2001 From: Manuel Bachmann Date: Tue, 3 Jun 2014 14:00:05 +0200 Subject: [PATCH] Fix the list emptying logic. Change-Id: I6fda7f02968a354eb47f8111eeaefc0eae5faf1b Signed-off-by: Manuel Bachmann --- notification_display_service.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/notification_display_service.c b/notification_display_service.c index e039088..a1b56f1 100644 --- a/notification_display_service.c +++ b/notification_display_service.c @@ -31,7 +31,7 @@ void display_notifications () notification_get_list (NOTIFICATION_TYPE_NOTI, -1, ¬ification_list); if (notification_list) { get_list = notification_list_get_head (notification_list); - if (get_list) { + while (get_list) { noti = notification_list_get_data (get_list); notification_get_pkgname (noti, &pkgname); if (pkgname == NULL) @@ -50,7 +50,8 @@ void display_notifications () wlmessage_destroy (wlmessage); # endif - notification_delete (noti); + get_list = notification_list_remove(get_list, noti); + notification_delete(noti); } } } -- 2.7.4