mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -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:
@@ -4597,7 +4597,13 @@ win_free(wp, tp)
|
||||
if (wp != aucmd_win)
|
||||
#endif
|
||||
win_remove(wp, tp);
|
||||
vim_free(wp);
|
||||
if (autocmd_busy)
|
||||
{
|
||||
wp->w_next = au_pending_free_win;
|
||||
au_pending_free_win = wp;
|
||||
}
|
||||
else
|
||||
vim_free(wp);
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
unblock_autocmds();
|
||||
|
Reference in New Issue
Block a user