summaryrefslogtreecommitdiffstats
path: root/src/fileio.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-10-14 21:41:01 +0200
committerBram Moolenaar <Bram@vim.org>2018-10-14 21:41:01 +0200
commit27e80c885bcb5c5cf6a6462d71d6c81b06ba2451 (patch)
tree5f23ab7eeb2ddc833a739d7c0ac62c0dd3a2e863 /src/fileio.c
parenta16bc5450359294f9d8585da9f74e5082108b7fb (diff)
patch 8.1.0475: memory not freed on exit when quit in autocmdv8.1.0475
Problem: Memory not freed on exit when quit in autocmd. Solution: Remember funccal stack when executing autocmd.
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 4380067fd5..afc5157d9d 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -9400,7 +9400,7 @@ apply_autocmds_group(
AutoPat *ap;
#ifdef FEAT_EVAL
sctx_T save_current_sctx;
- void *save_funccalp;
+ funccal_entry_T funccal_entry;
char_u *save_cmdarg;
long save_cmdbang;
#endif
@@ -9615,8 +9615,8 @@ apply_autocmds_group(
prof_child_enter(&wait_time); /* doesn't count for the caller itself */
# endif
- /* Don't use local function variables, if called from a function */
- save_funccalp = save_funccal();
+ // Don't use local function variables, if called from a function.
+ save_funccal(&funccal_entry);
#endif
/*
@@ -9713,7 +9713,7 @@ apply_autocmds_group(
autocmd_match = save_autocmd_match;
#ifdef FEAT_EVAL
current_sctx = save_current_sctx;
- restore_funccal(save_funccalp);
+ restore_funccal();
# ifdef FEAT_PROFILE
if (do_profiling == PROF_YES)
prof_child_exit(&wait_time);