mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user