From fac398accd9ef50cab9e89844964389cd48abe86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Tue, 9 Sep 2014 09:53:46 +0200 Subject: Fix a few memory leaks --- main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index f3435d8..1c4843d 100644 --- a/main.c +++ b/main.c @@ -166,8 +166,8 @@ static void setup() { } static void cleanup() { - vis_free(vis); endwin(); + //delscreen(set_term(NULL)); } static bool keymatch(Key *key0, Key *key1) { @@ -241,7 +241,7 @@ int main(int argc, char *argv[]) { struct timeval idle = { .tv_usec = 0 }, *timeout = NULL; Key key, key_prev, *key_mod = NULL; - for (;;) { + while (vis->running) { if (screen.need_resize) { resize_screen(&screen); vis_resize(vis, screen.w, screen.h); @@ -299,6 +299,7 @@ int main(int argc, char *argv[]) { timeout = &idle; } + vis_free(vis); cleanup(); return 0; } -- cgit v1.2.3