mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.1.0868: crash if triggering garbage collector after a function call
Problem: Crash if triggering garbage collector after a function call.
(Michael Henry)
Solution: Don't call the garbage collector right away, do it later.
(closes vim/vim#3894)
889da2f243
This commit is contained in:
parent
66369cd9d0
commit
a89d64b687
@ -613,10 +613,10 @@ static void cleanup_function_call(funccall_T *fc)
|
||||
if (++made_copy == 10000) {
|
||||
// We have made a lot of copies. This can happen when
|
||||
// repetitively calling a function that creates a reference to
|
||||
// itself somehow. Call the garbage collector here to avoid using
|
||||
// itself somehow. Call the garbage collector soon to avoid using
|
||||
// too much memory.
|
||||
made_copy = 0;
|
||||
(void)garbage_collect(false);
|
||||
want_garbage_collect = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user