mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.1905: the wininfo list may contain stale entries
Problem: The wininfo list may contain stale entries. Solution: When closing a window remove any other entry where the window pointer is NULL.
This commit is contained in:
25
src/buffer.c
25
src/buffer.c
@@ -1005,6 +1005,22 @@ free_buffer_stuff(
|
||||
VIM_CLEAR(buf->b_start_fenc);
|
||||
}
|
||||
|
||||
/*
|
||||
* Free one wininfo_T.
|
||||
*/
|
||||
void
|
||||
free_wininfo(wininfo_T *wip)
|
||||
{
|
||||
if (wip->wi_optset)
|
||||
{
|
||||
clear_winopt(&wip->wi_opt);
|
||||
#ifdef FEAT_FOLDING
|
||||
deleteFoldRecurse(&wip->wi_folds);
|
||||
#endif
|
||||
}
|
||||
vim_free(wip);
|
||||
}
|
||||
|
||||
/*
|
||||
* Free the b_wininfo list for buffer "buf".
|
||||
*/
|
||||
@@ -1017,14 +1033,7 @@ clear_wininfo(buf_T *buf)
|
||||
{
|
||||
wip = buf->b_wininfo;
|
||||
buf->b_wininfo = wip->wi_next;
|
||||
if (wip->wi_optset)
|
||||
{
|
||||
clear_winopt(&wip->wi_opt);
|
||||
#ifdef FEAT_FOLDING
|
||||
deleteFoldRecurse(&wip->wi_folds);
|
||||
#endif
|
||||
}
|
||||
vim_free(wip);
|
||||
free_wininfo(wip);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user