From 989a70c590c2bd109eb362d3a0e48cb1427ae13d Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 16 Aug 2017 22:46:01 +0200 Subject: patch 8.0.0948: crash if timer closes window while dragging status line Problem: Crash if timer closes window while dragging status line. Solution: Check if the window still exists. (Yasuhiro Matsumoto, closes #1979) --- src/edit.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/edit.c') diff --git a/src/edit.c b/src/edit.c index e08370863..3a9b3aaf9 100644 --- a/src/edit.c +++ b/src/edit.c @@ -9418,7 +9418,7 @@ ins_mousescroll(int dir) { pos_T tpos; # if defined(FEAT_WINDOWS) - win_T *old_curwin = curwin; + win_T *old_curwin = curwin, *wp; # endif # ifdef FEAT_INS_EXPAND int did_scroll = FALSE; @@ -9435,7 +9435,10 @@ ins_mousescroll(int dir) col = mouse_col; /* find the window at the pointer coordinates */ - curwin = mouse_find_win(&row, &col); + wp = mouse_find_win(&row, &col); + if (wp == NULL) + return; + curwin = wp; curbuf = curwin->w_buffer; } if (curwin == old_curwin) -- cgit v1.2.1