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

patch 8.2.2989: Vim9: memory leak when debugging a :def function

Problem:    Vim9: memory leak when debugging a :def function.
Solution:   Free the debug instructions.
This commit is contained in:
Bram Moolenaar
2021-06-13 15:39:00 +02:00
parent c3a27bbd53
commit c2dec4cac4
2 changed files with 9 additions and 0 deletions

View File

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

View File

@@ -10045,6 +10045,13 @@ delete_def_function_contents(dfunc_T *dfunc, int mark_deleted)
VIM_CLEAR(dfunc->df_instr);
dfunc->df_instr = NULL;
}
if (dfunc->df_instr_debug != NULL)
{
for (idx = 0; idx < dfunc->df_instr_debug_count; ++idx)
delete_instr(dfunc->df_instr_debug + idx);
VIM_CLEAR(dfunc->df_instr_debug);
dfunc->df_instr_debug = NULL;
}
#ifdef FEAT_PROFILE
if (dfunc->df_instr_prof != NULL)
{