mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 01:08:20 +00:00
vim-patch: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) https://code.google.com/p/vim/source/detail?r=v7-4-320
This commit is contained in:
@@ -6754,7 +6754,8 @@ apply_autocmds_group (
|
||||
--nesting; /* see matching increment above */
|
||||
|
||||
// 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) {
|
||||
restore_search_patterns();
|
||||
restoreRedobuff();
|
||||
@@ -6764,6 +6765,11 @@ apply_autocmds_group (
|
||||
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;
|
||||
free(au_pending_free_win);
|
||||
au_pending_free_win = w;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user