aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer_defs.h
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-04-20 10:05:02 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-04-21 19:07:50 +0800
commit1664e3d4bcc122e6a3b064a3fe20fdc163f6ae9d (patch)
tree050c5e32274e2b9c4bfb69fda5cdeb5b3e07ba00 /src/nvim/buffer_defs.h
parent407be5975db5dd63671397676eef0279662c603d (diff)
downloadrneovim-1664e3d4bcc122e6a3b064a3fe20fdc163f6ae9d.tar.gz
rneovim-1664e3d4bcc122e6a3b064a3fe20fdc163f6ae9d.tar.bz2
rneovim-1664e3d4bcc122e6a3b064a3fe20fdc163f6ae9d.zip
vim-patch:8.2.2476: using freed memory when splitting window while closing buffer
Problem: Using freed memory when using an autocommand to split a window while a buffer is being closed. Solution: Disallow splitting when the buffer has b_locked_split set. https://github.com/vim/vim/commit/983d83ff1cd796ff321074335fa53fbe7ac45a46 Put the error message in window.c. Cherry-pick a memory leak fix from Vim patch 8.2.0399. Test still fails.
Diffstat (limited to 'src/nvim/buffer_defs.h')
-rw-r--r--src/nvim/buffer_defs.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h
index 4917a628ff..baa0d1f102 100644
--- a/src/nvim/buffer_defs.h
+++ b/src/nvim/buffer_defs.h
@@ -532,6 +532,8 @@ struct file_buffer {
int b_flags; // various BF_ flags
int b_locked; // Buffer is being closed or referenced, don't
// let autocommands wipe it out.
+ int b_locked_split; // Buffer is being closed, don't allow opening
+ // a new window with it.
int b_ro_locked; // Non-zero when the buffer can't be changed.
// Used for FileChangedRO