forked from aniani/vim
patch 7.4.1704
Problem: Using freed memory with "wincmd p". (Dominique Pelle) Solution: Also clear "prevwin" in other tab pages.
This commit is contained in:
@@ -748,6 +748,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1704,
|
||||||
/**/
|
/**/
|
||||||
1703,
|
1703,
|
||||||
/**/
|
/**/
|
||||||
|
13
src/window.c
13
src/window.c
@@ -340,7 +340,7 @@ newwindow:
|
|||||||
/* cursor to last accessed (previous) window */
|
/* cursor to last accessed (previous) window */
|
||||||
case 'p':
|
case 'p':
|
||||||
case Ctrl_P:
|
case Ctrl_P:
|
||||||
if (prevwin == NULL)
|
if (!win_valid(prevwin))
|
||||||
beep_flush();
|
beep_flush();
|
||||||
else
|
else
|
||||||
win_goto(prevwin);
|
win_goto(prevwin);
|
||||||
@@ -4577,8 +4577,15 @@ win_free(
|
|||||||
unref_var_dict(wp->w_vars);
|
unref_var_dict(wp->w_vars);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (prevwin == wp)
|
{
|
||||||
prevwin = NULL;
|
tabpage_T *ttp;
|
||||||
|
|
||||||
|
if (prevwin == wp)
|
||||||
|
prevwin = NULL;
|
||||||
|
for (ttp = first_tabpage; ttp != NULL; ttp = ttp->tp_next)
|
||||||
|
if (ttp->tp_prevwin == wp)
|
||||||
|
ttp->tp_prevwin = NULL;
|
||||||
|
}
|
||||||
win_free_lsize(wp);
|
win_free_lsize(wp);
|
||||||
|
|
||||||
for (i = 0; i < wp->w_tagstacklen; ++i)
|
for (i = 0; i < wp->w_tagstacklen; ++i)
|
||||||
|
Reference in New Issue
Block a user