From f14510825856746cbade5ec6377c2ad3f7d9a269 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Fri, 21 Sep 2007 18:35:16 +0000 Subject: [PATCH] Tweak ordering. --- session.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/session.c b/session.c index d0ebafac..10a2750a 100644 --- a/session.c +++ b/session.c @@ -1,4 +1,4 @@ -/* $Id: session.c,v 1.11 2007-09-21 18:31:58 nicm Exp $ */ +/* $Id: session.c,v 1.12 2007-09-21 18:35:16 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -130,16 +130,16 @@ int session_detach(struct session *s, struct window *w) { window_remove(&s->windows, w); + if (ARRAY_EMPTY(&s->windows)) { + session_destroy(s); + return (1); + } if (s->last == w) s->last = NULL; if (s->window == w && session_last(s) != 0 && session_previous(s) != 0) session_next(s); - - if (!ARRAY_EMPTY(&s->windows)) - return (0); - session_destroy(s); - return (1); + return (0); } /* Return if session has window. */