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

patch 8.2.2406: Vim9: profiled :def function leaks memory

Problem:    Vim9: profiled :def function leaks memory.
Solution:   Delete the profiled instructions.
This commit is contained in:
Bram Moolenaar
2021-01-24 21:30:48 +01:00
parent 4efd994829
commit c05fe07529
2 changed files with 11 additions and 0 deletions

View File

@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2406,
/**/
2405,
/**/

View File

@@ -8837,6 +8837,15 @@ delete_def_function_contents(dfunc_T *dfunc, int mark_deleted)
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;