mirror of
https://github.com/neovim/neovim.git
synced 2025-12-12 17:42:37 +00:00
vim-patch:8.2.2474: using freed memory when window is closed by autocommand
Problem: Using freed memory when window is closed by autocommand.
(houyunsong)
Solution: Check the window pointer is still valid.
2c7080bf1c
Add missing comment from Vim patch 8.0.1420.
Test fails.
This commit is contained in:
@@ -2313,7 +2313,10 @@ static bool qflist_valid(win_T *wp, unsigned int qf_id)
|
|||||||
qf_info_T *qi = &ql_info;
|
qf_info_T *qi = &ql_info;
|
||||||
|
|
||||||
if (wp) {
|
if (wp) {
|
||||||
qi = GET_LOC_LIST(wp);
|
if (!win_valid(wp)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
qi = GET_LOC_LIST(wp); // Location list
|
||||||
if (!qi) {
|
if (!qi) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2741,6 +2741,19 @@ func Test_autocmd_closing_cmdwin()
|
|||||||
only
|
only
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_autocmd_vimgrep()
|
||||||
|
augroup aucmd_vimgrep
|
||||||
|
au QuickfixCmdPre,BufNew,BufDelete,BufReadCmd * sb
|
||||||
|
au QuickfixCmdPre,BufNew,BufDelete,BufReadCmd * q9 | ||||||