0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.4631: crash when switching window in BufWipeout autocommand

Problem:    Crash when switching window in BufWipeout autocommand.
Solution:   Put any buffer in the window to avoid it being NULL.
            (closes #10024)
This commit is contained in:
Bram Moolenaar
2022-03-26 16:28:06 +00:00
parent bf269ed0b0
commit 347538fad0
4 changed files with 68 additions and 35 deletions

View File

@@ -708,6 +708,10 @@ aucmd_abort:
*/
if (wipe_buf)
{
// Do not wipe out the buffer if it is used in a window.
if (buf->b_nwindows > 0)
return FALSE;
if (action == DOBUF_WIPE_REUSE)
{
// we can re-use this buffer number, store it