Skip to content

Instantly share code, notes, and snippets.

@mattn
Created August 18, 2014 07:39
Show Gist options
  • Save mattn/0c58a7398c63ab4c3066 to your computer and use it in GitHub Desktop.
Save mattn/0c58a7398c63ab4c3066 to your computer and use it in GitHub Desktop.
diff -r 7af530381fec src/eval.c
--- a/src/eval.c Sun Aug 17 17:24:07 2014 +0200
+++ b/src/eval.c Mon Aug 18 16:39:16 2014 +0900
@@ -6899,8 +6899,8 @@
free_unref_items(copyID)
int copyID;
{
- dict_T *dd;
- list_T *ll;
+ dict_T *dd, *dd_next;
+ list_T *ll, *ll_next;
int did_free = FALSE;
/*
@@ -6912,11 +6912,10 @@
/* Free the Dictionary and ordinary items it contains, but don't
* recurse into Lists and Dictionaries, they will be in the list
* of dicts or list of lists. */
+ dd_next = dd->dv_used_next;
dict_free(dd, FALSE);
did_free = TRUE;
-
- /* restart, next dict may also have been freed */
- dd = first_dict;
+ dd = dd_next;
}
else
dd = dd->dv_used_next;
@@ -6933,11 +6932,10 @@
/* Free the List and ordinary items it contains, but don't recurse
* into Lists and Dictionaries, they will be in the list of dicts
* or list of lists. */
+ ll_next = ll->lv_used_next;
list_free(ll, FALSE);
did_free = TRUE;
-
- /* restart, next list may also have been freed */
- ll = first_list;
+ ll = ll_next;
}
else
ll = ll->lv_used_next;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment