summaryrefslogtreecommitdiff
path: root/src/fileio.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2014-06-12 14:01:31 +0200
committerBram Moolenaar <Bram@vim.org>2014-06-12 14:01:31 +0200
commit3be8585661f8b0a9b94e9bc1db6ebfa097c3270f (patch)
tree7dde9056432ebada1a3ce31f629eaf4f76a0d7fa /src/fileio.c
parent980e58f7b324980d40ce690506897d138e5e2b70 (diff)
downloadvim-git-3be8585661f8b0a9b94e9bc1db6ebfa097c3270f.tar.gz
updated for version 7.4.320v7.4.320
Problem: Possible crash when an BufLeave autocommand deletes the buffer. Solution: Check for the window pointer being valid. Postpone freeing the window until autocommands are done. (Yasuhiro Matsumoto)
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/fileio.c b/src/fileio.c
index a45ec2cfd..38dc2597d 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -9549,7 +9549,8 @@ apply_autocmds_group(event, fname, fname_io, force, group, buf, eap)
/*
* When stopping to execute autocommands, restore the search patterns and
- * the redo buffer. Free buffers in the au_pending_free_buf list.
+ * the redo buffer. Free any buffers in the au_pending_free_buf list and
+ * free any windows in the au_pending_free_win list.
*/
if (!autocmd_busy)
{
@@ -9562,6 +9563,12 @@ apply_autocmds_group(event, fname, fname_io, force, group, buf, eap)
vim_free(au_pending_free_buf);
au_pending_free_buf = b;
}
+ while (au_pending_free_win != NULL)
+ {
+ win_T *w = au_pending_free_win->w_next;
+ vim_free(au_pending_free_win);
+ au_pending_free_win = w;
+ }
}
/*