0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

updated for version 7.4a.044

Problem:    Test 96 sometimes fails.
Solution:   Clear window from b_wininfo in win_free().  (Suggestion by
            Yukihiro Nakadaira)
This commit is contained in:
Bram Moolenaar
2013-07-24 17:51:57 +02:00
parent af003f6384
commit ff18df03c3
2 changed files with 12 additions and 1 deletions

View File

@@ -4518,7 +4518,7 @@ win_alloc(after, hidden)
#if defined(FEAT_WINDOWS) || defined(PROTO)
/*
* remove window 'wp' from the window list and free the structure
* Remove window 'wp' from the window list and free the structure.
*/
static void
win_free(wp, tp)
@@ -4526,6 +4526,8 @@ win_free(wp, tp)
tabpage_T *tp; /* tab page "win" is in, NULL for current */
{
int i;
buf_T *buf;
wininfo_T *wip;
#ifdef FEAT_FOLDING
clearFolding(wp);
@@ -4586,6 +4588,13 @@ win_free(wp, tp)
vim_free(wp->w_localdir);
/* Remove the window from the b_wininfo lists, it may happen that the
* freed memory is re-used for another window. */
for (buf = firstbuf; buf != NULL; buf = buf->b_next)
for (wip = buf->b_wininfo; wip != NULL; wip = wip->wi_next)
if (wip->wi_win == wp)
wip->wi_win = NULL;
#ifdef FEAT_SEARCH_EXTRA
clear_matches(wp);
#endif