Problem: Restoring help snapshot accesses freed memory. (Dominique Pelle)
Solution: Don't restore a snapshot when the window closes.
test_goto \
test_gui \
test_hardcopy \
+ test_help \
test_help_tagjump \
test_hide \
test_history \
test_gn.res \
test_gui.res \
test_hardcopy.res \
+ test_help.res \
test_hide.res \
test_history.res \
test_hlsearch.res \
--- /dev/null
+" Tests for :help
+
+func Test_help_restore_snapshot()
+ help
+ set buftype=
+ help
+ edit x
+ help
+ helpclose
+endfunc
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 331,
/**/
330,
/**/
/*
* Check if frames "sn" and "fr" have the same layout, same following frames
- * and same children.
+ * and same children. And the window pointer is valid.
*/
static int
check_snapshot_rec(frame_T *sn, frame_T *fr)
|| (sn->fr_next != NULL
&& check_snapshot_rec(sn->fr_next, fr->fr_next) == FAIL)
|| (sn->fr_child != NULL
- && check_snapshot_rec(sn->fr_child, fr->fr_child) == FAIL))
+ && check_snapshot_rec(sn->fr_child, fr->fr_child) == FAIL)
+ || !win_valid(sn->fr_win))
return FAIL;
return OK;
}