diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-08-27 03:37:08 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-08-27 03:37:08 +0400 |
commit | 8ef934c73f3baeaa582efb8de906b27a3854979c (patch) | |
tree | 95dcb068fc96b3323e6ffe425ee6a7481b23eab4 /source/blender/blenkernel/intern/object.c | |
parent | cdd57d499434061de35af23790c993220922b206 (diff) |
ghash/bli-listbase edits, rename BLI_ghash_pop -> BLI_ghash_popkey (since it takes a key as an arg and isnt popping any element from the hash as you might expect).
add BLI_pophead/tail, since getting the first element from a list and removing it is a common task.
Diffstat (limited to 'source/blender/blenkernel/intern/object.c')
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 8f64ce6bef7..d54ccb17710 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -142,11 +142,9 @@ void BKE_object_update_base_layer(struct Scene *scene, Object *ob) void BKE_object_free_particlesystems(Object *ob) { - while (ob->particlesystem.first) { - ParticleSystem *psys = ob->particlesystem.first; - - BLI_remlink(&ob->particlesystem, psys); - + ParticleSystem *psys; + + while ((psys = BLI_pophead(&ob->particlesystem))) { psys_free(ob, psys); } } @@ -182,11 +180,9 @@ void BKE_object_free_curve_cache(Object *ob) void BKE_object_free_modifiers(Object *ob) { - while (ob->modifiers.first) { - ModifierData *md = ob->modifiers.first; - - BLI_remlink(&ob->modifiers, md); - + ModifierData *md; + + while ((md = BLI_pophead(&ob->modifiers))) { modifier_free(md); } |