swaybar: free the right item during tray destruction

Also added a comment to make more obvious the reason for comparing
sni->status[0] == 'N'
This commit is contained in:
Ian Fan 2019-01-02 22:31:05 +00:00
parent 140bc2dd5b
commit b666fc76a6
2 changed files with 3 additions and 3 deletions

View file

@ -79,7 +79,7 @@ void destroy_tray(struct swaybar_tray *tray) {
finish_host(&tray->host_xdg);
finish_host(&tray->host_kde);
for (int i = 0; i < tray->items->length; ++i) {
destroy_sni(tray->items->items[0]);
destroy_sni(tray->items->items[i]);
}
list_free(tray->items);
destroy_watcher(tray->watcher_xdg);