From cee52204ca030ce7814844e4dab8b4ed897ba3cc Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 11 Mar 2020 14:19:58 +0100 Subject: patch 8.2.0371: crash with combination of terminal popup and autocmd Problem: Crash with combination of terminal popup and autocmd. Solution: Disallow closing a popup that is the current window. Add a check that the current buffer is valid. (closes #5754) --- src/terminal.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/terminal.c') diff --git a/src/terminal.c b/src/terminal.c index d4c605ed8..34316d843 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -382,6 +382,7 @@ term_close_buffer(buf_T *buf, buf_T *old_curbuf) curwin->w_buffer = curbuf; ++curbuf->b_nwindows; } + CHECK_CURBUF; // Wiping out the buffer will also close the window and call // free_terminal(). -- cgit v1.2.1