From: NeilBrown Date: Fri, 11 Dec 2015 02:43:14 +0000 (+1100) Subject: Disconnect pane where possible before closing children. X-Git-Tag: lca2016~62 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=391099cc65d640c26b5f48c25d9b83de9ea21987;p=edlib.git Disconnect pane where possible before closing children. This limits multiple closes due to recursion to some extent. Signed-off-by: NeilBrown --- diff --git a/core-pane.c b/core-pane.c index 2720cb24..d0862eff 100644 --- a/core-pane.c +++ b/core-pane.c @@ -217,6 +217,9 @@ void pane_close(struct pane *p) p->damaged |= DAMAGED_CLOSED; pane_check(p); + list_del_init(&p->siblings); + pane_drop_notifiers(p); + while (!list_empty(&p->children)) { c = list_first_entry(&p->children, struct pane, siblings); pane_close(c); @@ -225,8 +228,6 @@ void pane_close(struct pane *p) pane_damaged(p->parent, DAMAGED_CURSOR); p->parent->focus = NULL; } - list_del_init(&p->siblings); - pane_drop_notifiers(p); pane_notify_close(p); if (p->handle) { struct cmd_info ci = {0};