0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

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.
This commit is contained in:
Bram Moolenaar
2018-10-14 21:41:01 +02:00
parent a16bc54503
commit 27e80c885b
8 changed files with 68 additions and 67 deletions

View File

@@ -859,9 +859,9 @@ eval_to_string_safe(
int use_sandbox)
{
char_u *retval;
void *save_funccalp;
funccal_entry_T funccal_entry;
save_funccalp = save_funccal();
save_funccal(&funccal_entry);
if (use_sandbox)
++sandbox;
++textlock;
@@ -869,7 +869,7 @@ eval_to_string_safe(
if (use_sandbox)
--sandbox;
--textlock;
restore_funccal(save_funccalp);
restore_funccal();
return retval;
}
@@ -8532,7 +8532,7 @@ read_viminfo_varlist(vir_T *virp, int writing)
char_u *tab;
int type = VAR_NUMBER;
typval_T tv;
void *save_funccal;
funccal_entry_T funccal_entry;
if (!writing && (find_viminfo_parameter('!') != NULL))
{
@@ -8581,9 +8581,9 @@ read_viminfo_varlist(vir_T *virp, int writing)
}
/* when in a function use global variables */
save_funccal = clear_current_funccal();
save_funccal(&funccal_entry);
set_var(virp->vir_line + 1, &tv, FALSE);
restore_current_funccal(save_funccal);
restore_funccal();
if (tv.v_type == VAR_STRING)
vim_free(tv.vval.v_string);