diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-02-07 23:07:10 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-02-07 23:24:05 +0400 |
commit | b3afbcab8ff2330c1473647be330a3ffe9b11885 (patch) | |
tree | e86b9c7d9676e63b8da92da79889dee13b8be186 /source/blender/blenkernel/intern/pointcache.c | |
parent | 1c24d954f4ac63f22b703756b6664a4ad1b363d4 (diff) |
ListBase API: add utility api funcs for clearing and checking empty
Diffstat (limited to 'source/blender/blenkernel/intern/pointcache.c')
-rw-r--r-- | source/blender/blenkernel/intern/pointcache.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 271160a54f0..df6534946fd 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -3045,12 +3045,9 @@ static PointCache *ptcache_copy(PointCache *cache, int copy_data) ncache= MEM_dupallocN(cache); - ncache->mem_cache.first = NULL; - ncache->mem_cache.last = NULL; + BLI_listbase_clear(&ncache->mem_cache); if (copy_data == FALSE) { - ncache->mem_cache.first = NULL; - ncache->mem_cache.last = NULL; ncache->cached_frames = NULL; /* flag is a mix of user settings and simulator/baking state */ @@ -3089,7 +3086,7 @@ PointCache *BKE_ptcache_copy_list(ListBase *ptcaches_new, ListBase *ptcaches_old { PointCache *cache = ptcaches_old->first; - ptcaches_new->first = ptcaches_new->last = NULL; + BLI_listbase_clear(ptcaches_new); for (; cache; cache=cache->next) BLI_addtail(ptcaches_new, ptcache_copy(cache, copy_data)); |