From f456e1cb30f58b21170f9035e0b8b93be45a0a54 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Fri, 21 Sep 2007 20:00:28 +0000 Subject: [PATCH] Reset s->window to NULL so it doesn't end up in s->last. --- session.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/session.c b/session.c index 10a2750a..b06ae1ef 100644 --- a/session.c +++ b/session.c @@ -1,4 +1,4 @@ -/* $Id: session.c,v 1.12 2007-09-21 18:35:16 nicm Exp $ */ +/* $Id: session.c,v 1.13 2007-09-21 20:00:28 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -137,8 +137,11 @@ session_detach(struct session *s, struct window *w) if (s->last == w) s->last = NULL; - if (s->window == w && session_last(s) != 0 && session_previous(s) != 0) - session_next(s); + if (s->window == w) { + s->window = NULL; + if (session_last(s) != 0 && session_previous(s) != 0) + session_next(s); + } return (0); }