0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

updated for version 7.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)
This commit is contained in:
Bram Moolenaar
2014-06-12 14:01:31 +02:00
parent 980e58f7b3
commit 3be8585661
5 changed files with 27 additions and 6 deletions

View File

@@ -371,7 +371,11 @@ close_buffer(win, buf, action, abort_if_last)
unload_buf = TRUE;
#endif
if (win != NULL)
if (win != NULL
#ifdef FEAT_WINDOWS
&& win_valid(win) /* in case autocommands closed the window */
#endif
)
{
/* Set b_last_cursor when closing the last window for the buffer.
* Remember the last cursor position and window options of the buffer.