diff options
Diffstat (limited to 'swaynag/swaynag.c')
-rw-r--r-- | swaynag/swaynag.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/swaynag/swaynag.c b/swaynag/swaynag.c index a2a0b412..e6dfd25f 100644 --- a/swaynag/swaynag.c +++ b/swaynag/swaynag.c @@ -407,9 +407,8 @@ void swaynag_destroy(struct swaynag *swaynag) { swaynag->run_display = false; free(swaynag->message); - while (swaynag->buttons->length) { - struct swaynag_button *button = swaynag->buttons->items[0]; - list_del(swaynag->buttons, 0); + for (int i = 0; i < swaynag->buttons->length; ++i) { + struct swaynag_button *button = swaynag->buttons->items[i]; free(button->text); free(button->action); free(button); |