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

updated for version 7.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)
This commit is contained in:
Bram Moolenaar
2013-09-25 21:00:28 +02:00
parent 2ee95f7d13
commit cca7413456
2 changed files with 6 additions and 3 deletions

View File

@@ -915,12 +915,13 @@ eval_clear()
/* autoloaded script names */ /* autoloaded script names */
ga_clear_strings(&ga_loaded); 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) for (i = 1; i <= ga_scripts.ga_len; ++i)
{
vars_clear(&SCRIPT_VARS(i)); vars_clear(&SCRIPT_VARS(i));
for (i = 1; i <= ga_scripts.ga_len; ++i)
vim_free(SCRIPT_SV(i)); vim_free(SCRIPT_SV(i));
}
ga_clear(&ga_scripts); ga_clear(&ga_scripts);
/* unreferenced lists and dicts */ /* unreferenced lists and dicts */

View File

@@ -738,6 +738,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
40,
/**/ /**/
39, 39,
/**/ /**/