mirror of
https://github.com/neovim/neovim.git
synced 2025-09-20 02:08:17 +00:00
vim-patch:8.1.1485: double free when garbage_collect() is used in autocommand
Problem: Double free when garbage_collect() is used in autocommand.
Solution: Have garbage collection also set the copyID in funccal_stack.
c07f67ad0e
This commit is contained in:
@@ -439,12 +439,11 @@ void eval_clear(void)
|
||||
xfree(SCRIPT_SV(i));
|
||||
ga_clear(&ga_scripts);
|
||||
|
||||
// functions need to be freed before gargabe collecting, otherwise local
|
||||
// variables might be freed twice.
|
||||
free_all_functions();
|
||||
|
||||
// unreferenced lists and dicts
|
||||
(void)garbage_collect(false);
|
||||
|
||||
// functions not garbage collected
|
||||
free_all_functions();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user