diff options
author | Sergej Reich <sergej.reich@googlemail.com> | 2013-01-26 21:38:45 +0400 |
---|---|---|
committer | Sergej Reich <sergej.reich@googlemail.com> | 2013-01-26 21:38:45 +0400 |
commit | c84383301c5a2582e95259a7e4468a23a3566401 (patch) | |
tree | 1dd1df9d9cfb2cf5714f5ed5762f2cb5e2d56160 /source/blender/blenkernel | |
parent | 7e49a39acda5cdc86ce87470f7dc10cd80f1eba7 (diff) |
Fix [#34005] blender will close immediately in debug mode on deleting objects
Was silly mistake from rigidbody merge, base was used after it's been
freed.
Now don't free base in BKE_scene_base_remove() and rename it to
BKE_scene_base_unlink().
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_scene.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h index 2ac32a3f651..9bf0991272a 100644 --- a/source/blender/blenkernel/BKE_scene.h +++ b/source/blender/blenkernel/BKE_scene.h @@ -72,7 +72,7 @@ struct Scene *BKE_scene_add(struct Main *bmain, const char *name); /* base functions */ struct Base *BKE_scene_base_find(struct Scene *scene, struct Object *ob); struct Base *BKE_scene_base_add(struct Scene *sce, struct Object *ob); -void BKE_scene_base_remove(struct Scene *sce, struct Base *base); +void BKE_scene_base_unlink(struct Scene *sce, struct Base *base); void BKE_scene_base_deselect_all(struct Scene *sce); void BKE_scene_base_select(struct Scene *sce, struct Base *selbase); int BKE_scene_base_iter_next(struct Scene **scene, int val, struct Base **base, struct Object **ob); diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index fa3dac67a7f..9e8cf985f71 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -941,7 +941,7 @@ Base *BKE_scene_base_add(Scene *sce, Object *ob) return b; } -void BKE_scene_base_remove(Scene *sce, Base *base) +void BKE_scene_base_unlink(Scene *sce, Base *base) { /* remove rigid body constraint from world before removing object */ if (base->object->rigidbody_constraint) @@ -951,7 +951,6 @@ void BKE_scene_base_remove(Scene *sce, Base *base) BKE_rigidbody_remove_object(sce, base->object); BLI_remlink(&sce->base, base); - MEM_freeN(base); } void BKE_scene_base_deselect_all(Scene *sce) |