Mercurial > vim
diff src/fileio.c @ 14927:162d79d273e6 v8.1.0475
patch 8.1.0475: memory not freed on exit when quit in autocmd
commit https://github.com/vim/vim/commit/27e80c885bcb5c5cf6a6462d71d6c81b06ba2451
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Oct 14 21:41:01 2018 +0200
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 14 Oct 2018 21:45:04 +0200 |
parents | 6f2ce3b311de |
children | 6e4e0d43b20b |
line wrap: on
line diff
--- 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);