aboutsummaryrefslogtreecommitdiff
path: root/terminal.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-02-08 11:24:09 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-02-08 11:24:09 +0000
commit274e5ce5af542ba99fe89d458c8bbbb3f1e9a868 (patch)
tree58bc014c759d125b9c143283c5502219013e5f77 /terminal.c
parentMerge branch 'url-detection' (diff)
parentmisc: when free:ing tll lists, prefer tll_remove() over tll_free() (diff)
Merge branch 'prefer-tll_remove-over-tll_free'
Diffstat (limited to 'terminal.c')
-rw-r--r--terminal.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/terminal.c b/terminal.c
index 91a442ec..8e1e1841 100644
--- a/terminal.c
+++ b/terminal.c
@@ -1474,20 +1474,25 @@ term_destroy(struct terminal *term)
xassert(tll_length(term->render.workers.queue) == 0);
tll_free(term->render.workers.queue);
- tll_foreach(term->ptmx_buffers, it)
+ tll_free(term->tab_stops);
+
+ tll_foreach(term->ptmx_buffers, it) {
free(it->item.data);
- tll_free(term->ptmx_buffers);
- tll_foreach(term->ptmx_paste_buffers, it)
+ tll_remove(term->ptmx_buffers, it);
+ }
+ tll_foreach(term->ptmx_paste_buffers, it) {
free(it->item.data);
- tll_free(term->ptmx_paste_buffers);
- tll_free(term->tab_stops);
+ tll_remove(term->ptmx_paste_buffers, it);
+ }
- tll_foreach(term->normal.sixel_images, it)
+ tll_foreach(term->normal.sixel_images, it) {
sixel_destroy(&it->item);
- tll_free(term->normal.sixel_images);
- tll_foreach(term->alt.sixel_images, it)
+ tll_remove(term->normal.sixel_images, it);
+ }
+ tll_foreach(term->alt.sixel_images, it) {
sixel_destroy(&it->item);
- tll_free(term->alt.sixel_images);
+ tll_remove(term->alt.sixel_images, it);
+ }
sixel_fini(term);
urls_reset(term);
@@ -1642,12 +1647,14 @@ term_reset(struct terminal *term, bool hard)
term->meta.esc_prefix = true;
term->meta.eight_bit = true;
- tll_foreach(term->normal.sixel_images, it)
+ tll_foreach(term->normal.sixel_images, it) {
sixel_destroy(&it->item);
- tll_free(term->normal.sixel_images);
- tll_foreach(term->alt.sixel_images, it)
+ tll_remove(term->normal.sixel_images, it);
+ }
+ tll_foreach(term->alt.sixel_images, it) {
sixel_destroy(&it->item);
- tll_free(term->alt.sixel_images);
+ tll_remove(term->alt.sixel_images, it);
+ }
#if defined(FOOT_IME_ENABLED) && FOOT_IME_ENABLED
term_ime_enable(term);