forked from aniani/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.
This commit is contained in:
@@ -2603,6 +2603,8 @@ qflist_valid(win_T *wp, int_u qf_id)
|
|||||||
|
|
||||||
if (wp != NULL)
|
if (wp != NULL)
|
||||||
{
|
{
|
||||||
|
if (!win_valid(wp))
|
||||||
|
return FALSE;
|
||||||
qi = GET_LOC_LIST(wp); // Location list
|
qi = GET_LOC_LIST(wp); // Location list
|
||||||
if (qi == NULL)
|
if (qi == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@@ -2783,4 +2783,18 @@ 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 |