summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <bram@vim.org>2010-07-12 21:38:19 +0200
committerBram Moolenaar <bram@vim.org>2010-07-12 21:38:19 +0200
commita0fef6be053cb20daa8534ef7013f75736aa3e81 (patch)
tree8505bc1603a0e50db0ff892f294925cb847df590
parent3739afefd83530965aa018c71b78b27b91415797 (diff)
downloadvim-a0fef6be053cb20daa8534ef7013f75736aa3e81.tar.gz
updated for version 7.2.446v7.2.446
Problem: Crash in GUI when closing the last window in a tabpage. (ryo7000) Solution: Remove the tabpage from the list before freeing the window.
-rw-r--r--src/version.c2
-rw-r--r--src/window.c14
2 files changed, 11 insertions, 5 deletions
diff --git a/src/version.c b/src/version.c
index c0096972..19e64dde 100644
--- a/src/version.c
+++ b/src/version.c
@@ -682,6 +682,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 446,
+/**/
445,
/**/
444,
diff --git a/src/window.c b/src/window.c
index cc114cca..1dccb5a7 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2304,6 +2304,7 @@ win_close_othertab(win, free_buf, tp)
win_T *wp;
int dir;
tabpage_T *ptp = NULL;
+ int free_tp = FALSE;
/* Close the link to the buffer. */
close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0);
@@ -2321,11 +2322,8 @@ win_close_othertab(win, free_buf, tp)
if (wp == NULL)
return;
- /* Free the memory used for the window. */
- wp = win_free_mem(win, &dir, tp);
-
/* When closing the last window in a tab page remove the tab page. */
- if (wp == NULL)
+ if (tp == NULL ? firstwin == lastwin : tp->tp_firstwin == tp->tp_lastwin)
{
if (tp == first_tabpage)
first_tabpage = tp->tp_next;
@@ -2341,8 +2339,14 @@ win_close_othertab(win, free_buf, tp)
}
ptp->tp_next = tp->tp_next;
}
- free_tabpage(tp);
+ free_tp = TRUE;
}
+
+ /* Free the memory used for the window. */
+ win_free_mem(win, &dir, tp);
+
+ if (free_tp)
+ free_tabpage(tp);
}
/*