diff options
author | Ryan Dwyer <[email protected]> | 2018-12-09 21:50:19 +1000 |
---|---|---|
committer | GitHub <[email protected]> | 2018-12-09 21:50:19 +1000 |
commit | b61a936c8060bc4ac4320a5f76fd98b5042e5e41 (patch) | |
tree | 279a5554686d6e862282c943bda50787b69711e1 /sway/tree/container.c | |
parent | e7efa0e27b7bf44217d7f147281d463708d2dfc9 (diff) | |
parent | 98c1e19466c0d83c8e1ca86eda5b273eda7eff3c (diff) |
Merge pull request #3271 from ianyfan/list-cleanup
list.c: Remove list_foreach
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r-- | sway/tree/container.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index 91e8dd7f..b106e0d9 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -21,6 +21,7 @@ #include "sway/tree/arrange.h" #include "sway/tree/view.h" #include "sway/tree/workspace.h" +#include "list.h" #include "log.h" #include "stringop.h" @@ -67,8 +68,7 @@ void container_destroy(struct sway_container *con) { list_free(con->current.children); list_free(con->outputs); - list_foreach(con->marks, free); - list_free(con->marks); + list_free_items_and_destroy(con->marks); wlr_texture_destroy(con->marks_focused); wlr_texture_destroy(con->marks_focused_inactive); wlr_texture_destroy(con->marks_unfocused); @@ -1267,7 +1267,9 @@ bool container_find_and_unmark(char *mark) { } void container_clear_marks(struct sway_container *con) { - list_foreach(con->marks, free); + for (int i = 0; i < con->marks->length; ++i) { + free(con->marks->items[i]); + } con->marks->length = 0; ipc_event_window(con, "mark"); } |