mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 14:38:32 +00:00
vim-patch:7.4.251
Problem: Crash when BufAdd autocommand wipes out the buffer. Solution: Check for buffer to still be valid. Postpone freeing the buffer structure. (Hirohito Higashi) https://code.google.com/p/vim/source/detail?r=29eb4c2a33ac701bfcd4d2e2bed7864eba876e0e
This commit is contained in:

committed by
Thiago de Arruda

parent
40970917dc
commit
cb0adf60de
11
src/fileio.c
11
src/fileio.c
@@ -7525,14 +7525,17 @@ apply_autocmds_group (
|
||||
vim_free(sfname);
|
||||
--nesting; /* see matching increment above */
|
||||
|
||||
/*
|
||||
* When stopping to execute autocommands, restore the search patterns and
|
||||
* the redo buffer.
|
||||
*/
|
||||
// When stopping to execute autocommands, restore the search patterns and
|
||||
// the redo buffer. Free buffers in the au_pending_free_buf list.
|
||||
if (!autocmd_busy) {
|
||||
restore_search_patterns();
|
||||
restoreRedobuff();
|
||||
did_filetype = FALSE;
|
||||
while (au_pending_free_buf != NULL) {
|
||||
buf_T *b = au_pending_free_buf->b_next;
|
||||
vim_free(au_pending_free_buf);
|
||||
au_pending_free_buf = b;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user