mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.3753: Vim9: function unreferenced while called is never deleted
Problem: Vim9: function unreferenced while called is never deleted. Solution: Delete a function when no longer referenced.
This commit is contained in:
@@ -4988,8 +4988,9 @@ call_def_function(
|
||||
estack_pop();
|
||||
current_sctx = save_current_sctx;
|
||||
|
||||
// TODO: when is it safe to delete the function if it is no longer used?
|
||||
--ufunc->uf_calls;
|
||||
if (--ufunc->uf_calls <= 0 && ufunc->uf_refcount <= 0)
|
||||
// Function was unreferenced while being used, free it now.
|
||||
func_clear_free(ufunc, FALSE);
|
||||
|
||||
if (*msg_list != NULL && saved_msg_list != NULL)
|
||||
{
|
||||
|
Reference in New Issue
Block a user