patch 8.0.0700: segfault with QuitPre autocommand closes the window
Problem: Segfault with QuitPre autocommand closes the window. (Marek)
Solution: Check that the window pointer is still valid. (Christian Brabandt,
closes #1817)
diff --git a/src/testdir/test_tabpage.vim b/src/testdir/test_tabpage.vim
index c139958..239b1b9 100644
--- a/src/testdir/test_tabpage.vim
+++ b/src/testdir/test_tabpage.vim
@@ -473,5 +473,23 @@
endwhile
endfunc
+func Test_close_on_quitpre()
+ " This once caused a crash
+ new
+ only
+ set bufhidden=delete
+ au QuitPre <buffer> close
+ tabnew tab1
+ tabnew tab2
+ 1tabn
+ q!
+ call assert_equal(1, tabpagenr())
+ call assert_equal(2, tabpagenr('$'))
+ " clean up
+ while tabpagenr('$') > 1
+ bwipe!
+ endwhile
+ 1b
+endfunc
" vim: shiftwidth=2 sts=2 expandtab