Mercurial > vim
diff src/vim9compile.c @ 23729:7eef04861034 v8.2.2406
patch 8.2.2406: Vim9: profiled :def function leaks memory
Commit: https://github.com/vim/vim/commit/c05fe07529f10fc32a2086cb44a708520c8d14ce
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 24 21:30:48 2021 +0100
patch 8.2.2406: Vim9: profiled :def function leaks memory
Problem: Vim9: profiled :def function leaks memory.
Solution: Delete the profiled instructions.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 24 Jan 2021 21:45:05 +0100 |
parents | f98692ae09a0 |
children | 7caffd835aa1 |
line wrap: on
line diff
--- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -8837,6 +8837,15 @@ delete_def_function_contents(dfunc_T *df VIM_CLEAR(dfunc->df_instr); dfunc->df_instr = NULL; } +#ifdef FEAT_PROFILE + if (dfunc->df_instr_prof != NULL) + { + for (idx = 0; idx < dfunc->df_instr_prof_count; ++idx) + delete_instr(dfunc->df_instr_prof + idx); + VIM_CLEAR(dfunc->df_instr_prof); + dfunc->df_instr_prof = NULL; + } +#endif if (mark_deleted) dfunc->df_deleted = TRUE;