mirror of
https://github.com/tmux/tmux.git
synced 2026-10-11 21:14:21 +00:00
Free any remaining items when destroying screen, from Jeong, Heon.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: screen-write.c,v 1.288 2026/08/21 09:53:04 nicm Exp $ */
|
/* $OpenBSD: screen-write.c,v 1.289 2026/08/24 14:07:56 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||||
@@ -338,10 +338,18 @@ screen_write_make_list(struct screen *s)
|
|||||||
void
|
void
|
||||||
screen_write_free_list(struct screen *s)
|
screen_write_free_list(struct screen *s)
|
||||||
{
|
{
|
||||||
u_int y;
|
struct screen_write_cline *cl;
|
||||||
|
struct screen_write_citem *ci, *ci1;
|
||||||
|
u_int y;
|
||||||
|
|
||||||
for (y = 0; y < screen_size_y(s); y++)
|
for (y = 0; y < screen_size_y(s); y++) {
|
||||||
free(s->write_list[y].data);
|
cl = &s->write_list[y];
|
||||||
|
TAILQ_FOREACH_SAFE(ci, &cl->items, entry, ci1) {
|
||||||
|
TAILQ_REMOVE(&cl->items, ci, entry);
|
||||||
|
screen_write_free_citem(ci);
|
||||||
|
}
|
||||||
|
free(cl->data);
|
||||||
|
}
|
||||||
free(s->write_list);
|
free(s->write_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user