summaryrefslogtreecommitdiffstats
path: root/screen.c
diff options
context:
space:
mode:
Diffstat (limited to 'screen.c')
-rw-r--r--screen.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/screen.c b/screen.c
index a9b7d40e..a7c6195b 100644
--- a/screen.c
+++ b/screen.c
@@ -88,6 +88,10 @@ screen_init(struct screen *s, u_int sx, u_int sy, u_int hlimit)
s->tabs = NULL;
s->sel = NULL;
+#ifdef ENABLE_SIXEL
+ TAILQ_INIT(&s->images);
+#endif
+
s->write_list = NULL;
s->hyperlinks = NULL;
@@ -119,6 +123,11 @@ screen_reinit(struct screen *s)
screen_clear_selection(s);
screen_free_titles(s);
+
+#ifdef ENABLE_SIXEL
+ image_free_all(s);
+#endif
+
screen_reset_hyperlinks(s);
}
@@ -151,6 +160,10 @@ screen_free(struct screen *s)
if (s->hyperlinks != NULL)
hyperlinks_free(s->hyperlinks);
screen_free_titles(s);
+
+#ifdef ENABLE_SIXEL
+ image_free_all(s);
+#endif
}
/* Reset tabs to default, eight spaces apart. */
@@ -294,8 +307,12 @@ screen_resize_cursor(struct screen *s, u_int sx, u_int sy, int reflow,
if (sy != screen_size_y(s))
screen_resize_y(s, sy, eat_empty, &cy);
- if (reflow)
+ if (reflow) {
+#ifdef ENABLE_SIXEL
+ image_free_all(s);
+#endif
screen_reflow(s, sx, &cx, &cy, cursor);
+ }
if (cy >= s->grid->hsize) {
s->cx = cx;