forked from aniani/vim
patch 9.0.1125: memory leak when using class functions
Problem: Memory leak when using class functions. Solution: Clear and free the array with class functions.
This commit is contained in:
@@ -695,6 +695,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1125,
|
||||||
/**/
|
/**/
|
||||||
1124,
|
1124,
|
||||||
/**/
|
/**/
|
||||||
|
@@ -975,6 +975,13 @@ class_unref(class_T *cl)
|
|||||||
}
|
}
|
||||||
vim_free(cl->class_obj_members);
|
vim_free(cl->class_obj_members);
|
||||||
|
|
||||||
|
for (int i = 0; i < cl->class_class_function_count; ++i)
|
||||||
|
{
|
||||||
|
ufunc_T *uf = cl->class_class_functions[i];
|
||||||
|
func_clear_free(uf, FALSE);
|
||||||
|
}
|
||||||
|
vim_free(cl->class_class_functions);
|
||||||
|
|
||||||
for (int i = 0; i < cl->class_obj_method_count; ++i)
|
for (int i = 0; i < cl->class_obj_method_count; ++i)
|
||||||
{
|
{
|
||||||
ufunc_T *uf = cl->class_obj_methods[i];
|
ufunc_T *uf = cl->class_obj_methods[i];
|
||||||
|
Reference in New Issue
Block a user