0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 8.1.1575: callbacks may be garbage collected

Problem:    Callbacks may be garbage collected.
Solution:   Set reference in callbacks. (Ozaki Kiichi, closes #4564)
This commit is contained in:
Bram Moolenaar
2019-06-20 03:45:36 +02:00
parent a3fce62c91
commit 75a1a9415b
13 changed files with 164 additions and 7 deletions

View File

@@ -4032,12 +4032,12 @@ set_ref_in_call_stack(int copyID)
funccall_T *fc;
funccal_entry_T *entry;
for (fc = current_funccal; fc != NULL; fc = fc->caller)
for (fc = current_funccal; !abort && fc != NULL; fc = fc->caller)
abort = abort || set_ref_in_funccal(fc, copyID);
// Also go through the funccal_stack.
for (entry = funccal_stack; entry != NULL; entry = entry->next)
for (fc = entry->top_funccal; fc != NULL; fc = fc->caller)
for (entry = funccal_stack; !abort && entry != NULL; entry = entry->next)
for (fc = entry->top_funccal; !abort && fc != NULL; fc = fc->caller)
abort = abort || set_ref_in_funccal(fc, copyID);
return abort;