comparison 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
comparison
equal deleted inserted replaced
14926:f60f8f21f76f 14927:162d79d273e6
9398 static int nesting = 0; 9398 static int nesting = 0;
9399 AutoPatCmd patcmd; 9399 AutoPatCmd patcmd;
9400 AutoPat *ap; 9400 AutoPat *ap;
9401 #ifdef FEAT_EVAL 9401 #ifdef FEAT_EVAL
9402 sctx_T save_current_sctx; 9402 sctx_T save_current_sctx;
9403 void *save_funccalp; 9403 funccal_entry_T funccal_entry;
9404 char_u *save_cmdarg; 9404 char_u *save_cmdarg;
9405 long save_cmdbang; 9405 long save_cmdbang;
9406 #endif 9406 #endif
9407 static int filechangeshell_busy = FALSE; 9407 static int filechangeshell_busy = FALSE;
9408 #ifdef FEAT_PROFILE 9408 #ifdef FEAT_PROFILE
9613 # ifdef FEAT_PROFILE 9613 # ifdef FEAT_PROFILE
9614 if (do_profiling == PROF_YES) 9614 if (do_profiling == PROF_YES)
9615 prof_child_enter(&wait_time); /* doesn't count for the caller itself */ 9615 prof_child_enter(&wait_time); /* doesn't count for the caller itself */
9616 # endif 9616 # endif
9617 9617
9618 /* Don't use local function variables, if called from a function */ 9618 // Don't use local function variables, if called from a function.
9619 save_funccalp = save_funccal(); 9619 save_funccal(&funccal_entry);
9620 #endif 9620 #endif
9621 9621
9622 /* 9622 /*
9623 * When starting to execute autocommands, save the search patterns. 9623 * When starting to execute autocommands, save the search patterns.
9624 */ 9624 */
9711 autocmd_fname_full = save_autocmd_fname_full; 9711 autocmd_fname_full = save_autocmd_fname_full;
9712 autocmd_bufnr = save_autocmd_bufnr; 9712 autocmd_bufnr = save_autocmd_bufnr;
9713 autocmd_match = save_autocmd_match; 9713 autocmd_match = save_autocmd_match;
9714 #ifdef FEAT_EVAL 9714 #ifdef FEAT_EVAL
9715 current_sctx = save_current_sctx; 9715 current_sctx = save_current_sctx;
9716 restore_funccal(save_funccalp); 9716 restore_funccal();
9717 # ifdef FEAT_PROFILE 9717 # ifdef FEAT_PROFILE
9718 if (do_profiling == PROF_YES) 9718 if (do_profiling == PROF_YES)
9719 prof_child_exit(&wait_time); 9719 prof_child_exit(&wait_time);
9720 # endif 9720 # endif
9721 #endif 9721 #endif