diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-09-21 20:45:06 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-09-21 20:45:06 +0000 |
commit | 5ea2ac36e4eaf1ae3303ada380cad8b4bbcbfe8f (patch) | |
tree | 64cbff6b749f14366a951cb203b41b03778c3ad1 /window.c | |
parent | 70c1ba57706f47d4ea7539a85a735c2b31a673c1 (diff) |
Stop crashing when exiting windows.
Diffstat (limited to 'window.c')
-rw-r--r-- | window.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -1,4 +1,4 @@ -/* $Id: window.c,v 1.9 2007-09-21 18:20:44 nicm Exp $ */ +/* $Id: window.c,v 1.10 2007-09-21 20:45:06 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -181,9 +181,8 @@ window_remove(struct windows *ww, struct window *w) if (window_index(ww, w, &i) != 0) fatalx("window not found"); - if (i != ARRAY_LENGTH(ww) - 1) - ARRAY_SET(ww, i, NULL); - else + ARRAY_SET(ww, i, NULL); + while (!ARRAY_EMPTY(ww) && ARRAY_LAST(ww) == NULL) ARRAY_TRUNC(ww, 1); w->references--; |