aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--screen.c12
-rw-r--r--tmux.h3
-rw-r--r--window.c4
3 files changed, 16 insertions, 3 deletions
diff --git a/screen.c b/screen.c
index dc9a0363..5f939352 100644
--- a/screen.c
+++ b/screen.c
@@ -1,4 +1,4 @@
-/* $Id: screen.c,v 1.17 2007-09-29 18:57:15 nicm Exp $ */
+/* $Id: screen.c,v 1.18 2007-10-01 14:15:48 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -157,6 +157,16 @@ screen_resize(struct screen *s, u_int sx, u_int sy)
}
}
+/* Destroy a screen. */
+void
+screen_destroy(struct screen *s)
+{
+ screen_free_lines(s, 0, s->sy);
+ xfree(s->grid_data);
+ xfree(s->grid_attr);
+ xfree(s->grid_colr);
+}
+
/* Draw a set of lines on the screen. */
void
screen_draw(struct screen *s, struct buffer *b, u_int uy, u_int ly)
diff --git a/tmux.h b/tmux.h
index 9fa07e71..dd23f91f 100644
--- a/tmux.h
+++ b/tmux.h
@@ -1,4 +1,4 @@
-/* $Id: tmux.h,v 1.28 2007-09-30 13:02:14 nicm Exp $ */
+/* $Id: tmux.h,v 1.29 2007-10-01 14:15:48 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -565,6 +565,7 @@ void input_translate_key(struct buffer *, int);
/* screen.c */
void screen_create(struct screen *, u_int, u_int);
+void screen_destroy(struct screen *);
void screen_resize(struct screen *, u_int, u_int);
void screen_draw(struct screen *, struct buffer *, u_int, u_int);
size_t screen_store_attributes(struct buffer *, u_char);
diff --git a/window.c b/window.c
index c5ee1712..e29fd766 100644
--- a/window.c
+++ b/window.c
@@ -1,4 +1,4 @@
-/* $Id: window.c,v 1.14 2007-09-29 14:25:49 nicm Exp $ */
+/* $Id: window.c,v 1.15 2007-10-01 14:15:48 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -178,6 +178,8 @@ window_destroy(struct window *w)
input_free(&w->ictx);
+ screen_destroy(&w->screen);
+
buffer_destroy(w->in);
buffer_destroy(w->out);
xfree(w);