mirror of
https://github.com/neovim/neovim.git
synced 2025-09-15 15:58:17 +00:00
vim-patch:8.2.4631: crash when switching window in BufWipeout autocommand
Problem: Crash when switching window in BufWipeout autocommand.
Solution: Put any buffer in the window to avoid it being NULL.
(closes vim/vim#10024)
347538fad0
win_init_empty() cannot be made static because it is used in autocmd.c
This commit is contained in:
@@ -590,6 +590,10 @@ bool close_buffer(win_T *win, buf_T *buf, int action, bool abort_if_last)
|
||||
|
||||
// Remove the buffer from the list.
|
||||
if (wipe_buf) {
|
||||
// Do not wipe out the buffer if it is used in a window.
|
||||
if (buf->b_nwindows > 0) {
|
||||
return false;
|
||||
}
|
||||
if (buf->b_sfname != buf->b_ffname) {
|
||||
XFREE_CLEAR(buf->b_sfname);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user