mirror of
https://github.com/neovim/neovim.git
synced 2026-08-28 18:11:47 +00:00
vim-patch:9.1.1253: abort when closing window with attached quickfix data
Problem: If win_close() is called with a window that has quickfix stack
attached to it, the corresponding quickfix buffer will be
closed and freed after the buffer was already closed. At that
time curwin->w_buffer points to NULL, which the CHECK_CURBUF
will catch and abort if ABORT_ON_ERROR is defined
Solution: in wipe_qf_buffer() temporarily point curwin->w_buffer back to
curbuf, the window will be closed anyhow, so it shouldn't
matter that curbuf->b_nwindows isn't incremented.
closes: vim/vim#16993
closes: vim/vim#16985
ce80c59bfd
Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
This commit is contained in:
@@ -6596,4 +6596,12 @@ func Test_hardlink_fname()
|
||||
call Xtest_hardlink_fname('l')
|
||||
endfunc
|
||||
|
||||
func Test_quickfix_close_buffer_crash()
|
||||
new
|
||||
lexpr 'test' | lopen
|
||||
wincmd k
|
||||
lclose
|
||||
wincmd q
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
Reference in New Issue
Block a user