Mirror of the Vim source from https://github.com/vim/vim
Révision | f607f15ab091b6a51b0546db6a6d42adfa599c3d (tree) |
---|---|
l'heure | 2005-09-08 06:22:27 |
Auteur | vimboss |
Commiter | vimboss |
updated for version 7.0143
@@ -2831,6 +2831,8 @@ | ||
2831 | 2831 | } |
2832 | 2832 | else |
2833 | 2833 | { |
2834 | + /* No need to increment the refcount, it's already set for the | |
2835 | + * list being used in "tv". */ | |
2834 | 2836 | fi->fi_list = l; |
2835 | 2837 | list_add_watch(l, &fi->fi_lw); |
2836 | 2838 | fi->fi_lw.lw_item = l->lv_first; |
@@ -5861,14 +5863,16 @@ | ||
5861 | 5863 | |
5862 | 5864 | /* |
5863 | 5865 | * 3. Go through the list of lists and free items without the copyID. |
5866 | + * But don't free a list that has a watcher (used in a for loop), these | |
5867 | + * are not referenced anywhere. | |
5864 | 5868 | */ |
5865 | 5869 | for (ll = first_list; ll != NULL; ) |
5866 | - if (ll->lv_copyID != copyID) | |
5870 | + if (ll->lv_copyID != copyID && ll->lv_watch == NULL) | |
5867 | 5871 | { |
5868 | 5872 | list_free(ll); |
5869 | 5873 | did_free = TRUE; |
5870 | 5874 | |
5871 | - /* restart, next dict may also have been freed */ | |
5875 | + /* restart, next list may also have been freed */ | |
5872 | 5876 | ll = first_list; |
5873 | 5877 | } |
5874 | 5878 | else |