Problem: Valgrind error on exit when a script-local variable holds a
reference to the scope of another script.
Solution: First clear all variables, then free the scopes. (ZyX)
/* autoloaded script names */
ga_clear_strings(&ga_loaded);
- /* script-local variables */
+ /* Script-local variables. First clear all the variables and in a second
+ * loop free the scriptvar_T, because a variable in one script might hold
+ * a reference to the whole scope of another script. */
for (i = 1; i <= ga_scripts.ga_len; ++i)
- {
vars_clear(&SCRIPT_VARS(i));
+ for (i = 1; i <= ga_scripts.ga_len; ++i)
vim_free(SCRIPT_SV(i));
- }
ga_clear(&ga_scripts);
/* unreferenced lists and dicts */
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 40,
/**/
39,
/**/