Patch 9.0.1125

2 views
Skip to first unread message

Bram Moolenaar

unread,
Jan 1, 2023, 9:11:59 AM1/1/23
to vim...@googlegroups.com

Patch 9.0.1125
Problem: Memory leak when using class functions.
Solution: Clear and free the array with class functions.
Files: src/vim9class.c


*** ../vim-9.0.1124/src/vim9class.c 2023-01-01 12:58:29.470417543 +0000
--- src/vim9class.c 2023-01-01 14:08:39.318768288 +0000
***************
*** 975,980 ****
--- 975,987 ----
}
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)
{
ufunc_T *uf = cl->class_obj_methods[i];
*** ../vim-9.0.1124/src/version.c 2023-01-01 14:04:47.863216040 +0000
--- src/version.c 2023-01-01 14:09:32.910672794 +0000
***************
*** 697,698 ****
--- 697,700 ----
{ /* Add new patch number below this line */
+ /**/
+ 1125,
/**/

--
ARTHUR: If you do not open these doors, we will take this castle by force ...
[A bucket of slops land on ARTHUR. He tries to retain his dignity.]
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages