comparison src/window.c @ 22399:75513701ddd2 v8.2.1748

patch 8.2.1748: closing split window in other tab may cause a crash Commit: https://github.com/vim/vim/commit/f3c51bbff1256a52bdd9ede7887f40062be2628c Author: Bram Moolenaar <Bram@vim.org> Date: Sat Sep 26 19:11:39 2020 +0200 patch 8.2.1748: closing split window in other tab may cause a crash Problem: Closing split window in other tab may cause a crash. Solution: Set tp_curwin properly. (Rob Pilling, closes https://github.com/vim/vim/issues/7018)
author Bram Moolenaar <Bram@vim.org>
date Sat, 26 Sep 2020 19:15:03 +0200
parents 860cad58f557
children b74bdd85bb26
comparison
equal deleted inserted replaced
22398:ca9544b14e58 22399:75513701ddd2
2743 int *dirp, // set to 'v' or 'h' for direction if 'ea' 2743 int *dirp, // set to 'v' or 'h' for direction if 'ea'
2744 tabpage_T *tp) // tab page "win" is in, NULL for current 2744 tabpage_T *tp) // tab page "win" is in, NULL for current
2745 { 2745 {
2746 frame_T *frp; 2746 frame_T *frp;
2747 win_T *wp; 2747 win_T *wp;
2748 tabpage_T *win_tp = tp == NULL ? curtab : tp;
2748 2749
2749 // Remove the window and its frame from the tree of frames. 2750 // Remove the window and its frame from the tree of frames.
2750 frp = win->w_frame; 2751 frp = win->w_frame;
2751 wp = winframe_remove(win, dirp, tp); 2752 wp = winframe_remove(win, dirp, tp);
2752 vim_free(frp); 2753 vim_free(frp);
2753 win_free(win, tp); 2754 win_free(win, tp);
2754 2755
2755 // When deleting the current window of another tab page select a new 2756 // When deleting the current window in the tab, select a new current
2756 // current window. 2757 // window.
2757 if (tp != NULL && win == tp->tp_curwin) 2758 if (win == win_tp->tp_curwin)
2758 tp->tp_curwin = wp; 2759 win_tp->tp_curwin = wp;
2759 2760
2760 return wp; 2761 return wp;
2761 } 2762 }
2762 2763
2763 #if defined(EXITFREE) || defined(PROTO) 2764 #if defined(EXITFREE) || defined(PROTO)