patch 7.4.2137
Problem: Using function() with a name will find another function when it is
redefined.
Solution: Add funcref(). Refer to lambda using a partial. Fix several
reference counting issues.
diff --git a/src/misc2.c b/src/misc2.c
index 53469a2..f44c33c 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -1217,16 +1217,20 @@
if (delete_first_msg() == FAIL)
break;
-# ifdef FEAT_EVAL
- eval_clear();
-# endif
# ifdef FEAT_JOB_CHANNEL
channel_free_all();
- job_free_all();
# endif
#ifdef FEAT_TIMERS
timer_free_all();
#endif
+# ifdef FEAT_EVAL
+ /* must be after channel_free_all() with unrefs partials */
+ eval_clear();
+# endif
+# ifdef FEAT_JOB_CHANNEL
+ /* must be after eval_clear() with unrefs jobs */
+ job_free_all();
+# endif
free_termoptions();