summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-09-25 21:00:28 +0200
committerBram Moolenaar <Bram@vim.org>2013-09-25 21:00:28 +0200
commitcca74134564a99f638a583d79d2cfd3ca393673d (patch)
tree88cb0ae3689079f2bb0c3b9e6aa5cef7358c699a
parent2ee95f7d13566ba393ed70bd4401e7164b0cc2f9 (diff)
updated for version 7.4.040v7.4.040
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)
-rw-r--r--src/eval.c7
-rw-r--r--src/version.c2
2 files changed, 6 insertions, 3 deletions
diff --git a/src/eval.c b/src/eval.c
index 807efe25f3..03e3735ce9 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -915,12 +915,13 @@ eval_clear()
/* 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 */
diff --git a/src/version.c b/src/version.c
index 3495b0ee8e..c7a2011c14 100644
--- a/src/version.c
+++ b/src/version.c
@@ -739,6 +739,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 40,
+/**/
39,
/**/
38,