Mercurial > vim
comparison src/ex_cmds2.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 | 27b9a84395b5 |
children | 9ae60773dd03 |
comparison
equal
deleted
inserted
replaced
14926:f60f8f21f76f | 14927:162d79d273e6 |
---|---|
4342 char_u *firstline = NULL; | 4342 char_u *firstline = NULL; |
4343 int retval = FAIL; | 4343 int retval = FAIL; |
4344 #ifdef FEAT_EVAL | 4344 #ifdef FEAT_EVAL |
4345 sctx_T save_current_sctx; | 4345 sctx_T save_current_sctx; |
4346 static scid_T last_current_SID = 0; | 4346 static scid_T last_current_SID = 0; |
4347 void *save_funccalp; | 4347 funccal_entry_T funccalp_entry; |
4348 int save_debug_break_level = debug_break_level; | 4348 int save_debug_break_level = debug_break_level; |
4349 scriptitem_T *si = NULL; | 4349 scriptitem_T *si = NULL; |
4350 # ifdef UNIX | 4350 # ifdef UNIX |
4351 stat_T st; | 4351 stat_T st; |
4352 int stat_ok; | 4352 int stat_ok; |
4504 prof_child_enter(&wait_start); /* entering a child now */ | 4504 prof_child_enter(&wait_start); /* entering a child now */ |
4505 # endif | 4505 # endif |
4506 | 4506 |
4507 /* Don't use local function variables, if called from a function. | 4507 /* Don't use local function variables, if called from a function. |
4508 * Also starts profiling timer for nested script. */ | 4508 * Also starts profiling timer for nested script. */ |
4509 save_funccalp = save_funccal(); | 4509 save_funccal(&funccalp_entry); |
4510 | 4510 |
4511 /* | 4511 /* |
4512 * Check if this script was sourced before to finds its SID. | 4512 * Check if this script was sourced before to finds its SID. |
4513 * If it's new, generate a new SID. | 4513 * If it's new, generate a new SID. |
4514 */ | 4514 */ |
4663 #endif | 4663 #endif |
4664 | 4664 |
4665 #ifdef FEAT_EVAL | 4665 #ifdef FEAT_EVAL |
4666 almosttheend: | 4666 almosttheend: |
4667 current_sctx = save_current_sctx; | 4667 current_sctx = save_current_sctx; |
4668 restore_funccal(save_funccalp); | 4668 restore_funccal(); |
4669 # ifdef FEAT_PROFILE | 4669 # ifdef FEAT_PROFILE |
4670 if (do_profiling == PROF_YES) | 4670 if (do_profiling == PROF_YES) |
4671 prof_child_exit(&wait_start); /* leaving a child now */ | 4671 prof_child_exit(&wait_start); /* leaving a child now */ |
4672 # endif | 4672 # endif |
4673 #endif | 4673 #endif |