Merge branch 'prefer-tll_remove-over-tll_free'

This commit is contained in:
Daniel Eklöf 2021-02-08 12:24:09 +01:00
commit 274e5ce5af
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 36 additions and 25 deletions

View file

@ -2379,9 +2379,10 @@ config_load(struct config *conf, const char *conf_path,
conf->url_launch.raw_cmd = xstrdup("xdg-open ${url}");
tokenize_cmdline(conf->url_launch.raw_cmd, &conf->url_launch.argv);
tll_foreach(*initial_user_notifications, it)
tll_foreach(*initial_user_notifications, it) {
tll_push_back(conf->notifications, it->item);
tll_free(*initial_user_notifications);
tll_remove(*initial_user_notifications, it);
}
add_default_key_bindings(conf);
add_default_search_bindings(conf);
@ -2462,9 +2463,10 @@ config_free(struct config conf)
free_spawn_template(&conf.notify);
free_spawn_template(&conf.url_launch);
for (size_t i = 0; i < ALEN(conf.fonts); i++) {
tll_foreach(conf.fonts[i], it)
tll_foreach(conf.fonts[i], it) {
config_font_destroy(&it->item);
tll_free(conf.fonts[i]);
tll_remove(conf.fonts[i], it);
}
}
free(conf.server_socket_path);

View file

@ -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)
free(it->item.data);
tll_free(term->ptmx_buffers);
tll_foreach(term->ptmx_paste_buffers, it)
free(it->item.data);
tll_free(term->ptmx_paste_buffers);
tll_free(term->tab_stops);
tll_foreach(term->normal.sixel_images, it)
tll_foreach(term->ptmx_buffers, it) {
free(it->item.data);
tll_remove(term->ptmx_buffers, it);
}
tll_foreach(term->ptmx_paste_buffers, it) {
free(it->item.data);
tll_remove(term->ptmx_paste_buffers, 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);

View file

@ -540,15 +540,15 @@ urls_reset(struct terminal *term)
wl_subsurface_destroy(it->item.sub_surf);
if (it->item.surf != NULL)
wl_surface_destroy(it->item.surf);
tll_remove(term->window->urls, it);
}
tll_free(term->window->urls);
}
tll_foreach(term->urls, it) {
tag_cells_for_url(term, &it->item, false);
url_destroy(&it->item);
tll_remove(term->urls, it);
}
tll_free(term->urls);
memset(term->url_keys, 0, sizeof(term->url_keys));
render_refresh(term);

View file

@ -1240,13 +1240,15 @@ wayl_destroy(struct wayland *wayl)
fdm_hook_del(wayl->fdm, &fdm_hook, FDM_HOOK_PRIORITY_LOW);
tll_foreach(wayl->monitors, it)
tll_foreach(wayl->monitors, it) {
monitor_destroy(&it->item);
tll_free(wayl->monitors);
tll_remove(wayl->monitors, it);
}
tll_foreach(wayl->seats, it)
tll_foreach(wayl->seats, it) {
seat_destroy(&it->item);
tll_free(wayl->seats);
tll_remove(wayl->seats, it);
}
#if defined(FOOT_IME_ENABLED) && FOOT_IME_ENABLED
if (wayl->text_input_manager != NULL)
@ -1431,8 +1433,8 @@ wayl_win_destroy(struct wl_window *win)
wl_subsurface_destroy(it->item.sub_surf);
if (it->item.surf != NULL)
wl_surface_destroy(it->item.surf);
tll_remove(win->urls, it);
}
tll_free(win->urls);
csd_destroy(win);
if (win->render_timer_sub_surface != NULL)