diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-03-14 23:40:42 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-03-14 23:40:42 +0400 |
commit | a2a594fb3686921e3225a470bc96f61bc12287a8 (patch) | |
tree | 881cb18084b3c3528e6cef158c439ce218576e2c /source/blender/blenlib/intern/BLI_linklist.c | |
parent | 7626101dc9749a3c6066a0f51720d9953b8b3c69 (diff) |
BLI_linklist_free() was incorrectly taking MEM_freeN() as an argument, evidentially this works on x86 - but could cause issues later on.
add BLI_linklist_freeN() which MEM_freeN's each item.
Diffstat (limited to 'source/blender/blenlib/intern/BLI_linklist.c')
-rw-r--r-- | source/blender/blenlib/intern/BLI_linklist.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/BLI_linklist.c b/source/blender/blenlib/intern/BLI_linklist.c index 0e630efc349..b08fbe17a43 100644 --- a/source/blender/blenlib/intern/BLI_linklist.c +++ b/source/blender/blenlib/intern/BLI_linklist.c @@ -155,6 +155,18 @@ void BLI_linklist_free(LinkNode *list, LinkNodeFreeFP freefunc) } } +void BLI_linklist_freeN(LinkNode *list) +{ + while (list) { + LinkNode *next = list->next; + + MEM_freeN(list->link); + MEM_freeN(list); + + list = next; + } +} + void BLI_linklist_apply(LinkNode *list, LinkNodeApplyFP applyfunc, void *userdata) { for (; list; list = list->next) |