comparison src/fileio.c @ 11199:e08ead1d269f v8.0.0486

patch 8.0.0486: crash and endless loop when closing windows in autocmd commit https://github.com/vim/vim/commit/8c752bd6c4af54c0b7bac35a39acc2bf16015f85 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 19 17:09:56 2017 +0100 patch 8.0.0486: crash and endless loop when closing windows in autocmd Problem: Crash and endless loop when closing windows in a SessionLoadPost autocommand. Solution: Check for valid tabpage. (partly neovim #6308)
author Christian Brabandt <cb@256bit.org>
date Sun, 19 Mar 2017 17:15:05 +0100
parents 501f46f7644c
children 77f3b7316d8b
comparison
equal deleted inserted replaced
11198:011eb80f6e66 11199:e08ead1d269f
9031 /* Remove the window and frame from the tree of frames. */ 9031 /* Remove the window and frame from the tree of frames. */
9032 (void)winframe_remove(curwin, &dummy, NULL); 9032 (void)winframe_remove(curwin, &dummy, NULL);
9033 win_remove(curwin, NULL); 9033 win_remove(curwin, NULL);
9034 aucmd_win_used = FALSE; 9034 aucmd_win_used = FALSE;
9035 last_status(FALSE); /* may need to remove last status line */ 9035 last_status(FALSE); /* may need to remove last status line */
9036
9037 if (!valid_tabpage_win(curtab))
9038 /* no valid window in current tabpage */
9039 close_tabpage(curtab);
9040
9036 restore_snapshot(SNAP_AUCMD_IDX, FALSE); 9041 restore_snapshot(SNAP_AUCMD_IDX, FALSE);
9037 (void)win_comp_pos(); /* recompute window positions */ 9042 (void)win_comp_pos(); /* recompute window positions */
9038 unblock_autocmds(); 9043 unblock_autocmds();
9039 9044
9040 if (win_valid(aco->save_curwin)) 9045 if (win_valid(aco->save_curwin))