patch 8.1.1575: callbacks may be garbage collected
Problem: Callbacks may be garbage collected.
Solution: Set reference in callbacks. (Ozaki Kiichi, closes #4564)
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index af7aa4b..2537e8d 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -566,7 +566,7 @@
timer_T *timer;
typval_T tv;
- for (timer = first_timer; timer != NULL; timer = timer->tr_next)
+ for (timer = first_timer; !abort && timer != NULL; timer = timer->tr_next)
{
if (timer->tr_callback.cb_partial != NULL)
{