mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 05:58:33 +00:00
vim-patch:8.2.2464: using freed memory if window closed in autocommand
Problem: Using freed memory if window closed in autocommand. (houyunsong)
Solution: Check the window still exists.
8ab375706e
This commit is contained in:
@@ -2416,7 +2416,10 @@ int do_ecmd(
|
||||
(flags & ECMD_HIDE) || curbuf->terminal ? 0 : DOBUF_UNLOAD,
|
||||
false);
|
||||
|
||||
the_curwin->w_closing = false;
|
||||
// Autocommands may have closed the window.
|
||||
if (win_valid(the_curwin)) {
|
||||
the_curwin->w_closing = false;
|
||||
}
|
||||
buf->b_locked--;
|
||||
|
||||
// autocmds may abort script processing
|
||||
|
Reference in New Issue
Block a user