aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-11-29 19:02:29 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-11-29 20:36:31 +0800
commit95f5cf96912727a1ede055211645ac9779f3da44 (patch)
treedd2c01f384b4c3713a1d9c5b976cd7c0f8c91fcd /src/nvim/eval.c
parent3173d07564e7cdf0834099a379f0faf480c76224 (diff)
downloadrneovim-95f5cf96912727a1ede055211645ac9779f3da44.tar.gz
rneovim-95f5cf96912727a1ede055211645ac9779f3da44.tar.bz2
rneovim-95f5cf96912727a1ede055211645ac9779f3da44.zip
vim-patch:9.0.0967: leaking memory from autocmd windows
Problem: Leaking memory from autocmd windows. Solution: Free window when auc_win is not NULL. https://github.com/vim/vim/commit/84497cd06f06516f6ce727ea00c47792ce16dc70 Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r--src/nvim/eval.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index d316d60efa..c4afd6934c 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -4174,8 +4174,9 @@ bool garbage_collect(bool testing)
ABORTING(set_ref_in_fmark)(wp->w_jumplist[i].fmark, copyID);
}
}
+ // window-local variables in autocmd windows
for (int i = 0; i < AUCMD_WIN_COUNT; i++) {
- if (aucmd_win[i].auc_win_used) {
+ if (aucmd_win[i].auc_win != NULL) {
ABORTING(set_ref_in_item)(&aucmd_win[i].auc_win->w_winvar.di_tv, copyID, NULL, NULL);
}
}