Mercurial > vim
diff src/eval.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 | 0c845463a0db |
children | 2c0bfa167468 |
line wrap: on
line diff
--- a/src/eval.c +++ b/src/eval.c @@ -859,9 +859,9 @@ eval_to_string_safe( int use_sandbox) { char_u *retval; - void *save_funccalp; - - save_funccalp = save_funccal(); + funccal_entry_T funccal_entry; + + 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 wr 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 wr } /* 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);