vim-patch:8.1.1007: using closure may consume a lot of memory

Problem:    Using closure may consume a lot of memory.
Solution:   unreference items that are no longer needed. Add a test. (Ozaki
            Kiichi, closes vim/vim#3961)
209b8e3e3b
This commit is contained in:
erw7
2019-09-01 18:44:14 +09:00
parent 17f067f4b4
commit 1212390254
4 changed files with 227 additions and 46 deletions

View File

@@ -442,7 +442,8 @@ void eval_clear(void)
// unreferenced lists and dicts
(void)garbage_collect(false);
// functions
// functions need to be freed before gargabe collecting, otherwise local
// variables might be freed twice.
free_all_functions();
}