aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds2.c
diff options
context:
space:
mode:
authorerw7 <erw7.github@gmail.com>2019-08-31 15:09:30 +0900
committererw7 <erw7.github@gmail.com>2020-05-07 16:00:46 +0900
commit17f067f4b4799dde06be78f9b7c9e7c7d60900a2 (patch)
treec67ce740707feb31fe6bf55d8fbbd3ff3503d4ab /src/nvim/ex_cmds2.c
parentf04a9a2c9aa68f98a79b8d7e9917719a8be6049b (diff)
downloadrneovim-17f067f4b4799dde06be78f9b7c9e7c7d60900a2.tar.gz
rneovim-17f067f4b4799dde06be78f9b7c9e7c7d60900a2.tar.bz2
rneovim-17f067f4b4799dde06be78f9b7c9e7c7d60900a2.zip
vim-patch:8.1.0475: memory not freed on exit when quit in autocmd
Problem: Memory not freed on exit when quit in autocmd. Solution: Remember funccal stack when executing autocmd. https://github.com/vim/vim/commit/27e80c885bcb5c5cf6a6462d71d6c81b06ba2451
Diffstat (limited to 'src/nvim/ex_cmds2.c')
-rw-r--r--src/nvim/ex_cmds2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c
index fbdd64e43e..821227ec7a 100644
--- a/src/nvim/ex_cmds2.c
+++ b/src/nvim/ex_cmds2.c
@@ -3106,7 +3106,6 @@ int do_source(char_u *fname, int check_other, int is_vimrc)
int retval = FAIL;
static scid_T last_current_SID = 0;
static int last_current_SID_seq = 0;
- void *save_funccalp;
int save_debug_break_level = debug_break_level;
scriptitem_T *si = NULL;
proftime_T wait_start;
@@ -3227,7 +3226,8 @@ int do_source(char_u *fname, int check_other, int is_vimrc)
// Don't use local function variables, if called from a function.
// Also starts profiling timer for nested script.
- save_funccalp = save_funccal();
+ funccal_entry_T funccalp_entry;
+ save_funccal(&funccalp_entry);
// Check if this script was sourced before to finds its SID.
// If it's new, generate a new SID.
@@ -3352,7 +3352,7 @@ int do_source(char_u *fname, int check_other, int is_vimrc)
}
current_sctx = save_current_sctx;
- restore_funccal(save_funccalp);
+ restore_funccal();
if (l_do_profiling == PROF_YES) {
prof_child_exit(&wait_start); // leaving a child now
}