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:
@@ -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.
|
||||
|
Reference in New Issue
Block a user