diff options
author | Bram Moolenaar <Bram@vim.org> | 2005-09-07 21:22:27 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2005-09-07 21:22:27 +0000 |
commit | 7bb4c6e3f6d65bb6c0654d72dfe8cb5fa7f0fde2 (patch) | |
tree | 479eae02882575aa0bbf5e3c28636a60c70486cb /src/eval.c | |
parent | caa0fcfa6b50b98f54028b8d715a2c0a683e579b (diff) | |
download | vim-git-7bb4c6e3f6d65bb6c0654d72dfe8cb5fa7f0fde2.tar.gz |
updated for version 7.0143v7.0143
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/eval.c b/src/eval.c index 448bd7f30..3737126de 100644 --- a/src/eval.c +++ b/src/eval.c @@ -2831,6 +2831,8 @@ eval_for_line(arg, errp, nextcmdp, skip) } else { + /* No need to increment the refcount, it's already set for the + * list being used in "tv". */ fi->fi_list = l; list_add_watch(l, &fi->fi_lw); fi->fi_lw.lw_item = l->lv_first; @@ -5861,14 +5863,16 @@ garbage_collect() /* * 3. Go through the list of lists and free items without the copyID. + * But don't free a list that has a watcher (used in a for loop), these + * are not referenced anywhere. */ for (ll = first_list; ll != NULL; ) - if (ll->lv_copyID != copyID) + if (ll->lv_copyID != copyID && ll->lv_watch == NULL) { list_free(ll); did_free = TRUE; - /* restart, next dict may also have been freed */ + /* restart, next list may also have been freed */ ll = first_list; } else |