[Bf-blender-cvs] [cd5c853307] master: Fix memory leak when making duplicates real and parent had constraints

Sergey Sharybin noreply at git.blender.org
Mon Feb 27 17:47:36 CET 2017


Commit: cd5c853307aad8d982833d87ecc84e1303bc04b9
Author: Sergey Sharybin
Date:   Mon Feb 27 17:46:21 2017 +0100
Branches: master
https://developer.blender.org/rBcd5c853307aad8d982833d87ecc84e1303bc04b9

Fix memory leak when making duplicates real and parent had constraints

Thanks Bastien for help!

===================================================================

M	source/blender/editors/object/object_add.c

===================================================================

diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 02b2d8492b..ae458c722f 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -64,6 +64,7 @@
 #include "BKE_armature.h"
 #include "BKE_camera.h"
 #include "BKE_context.h"
+#include "BKE_constraint.h"
 #include "BKE_curve.h"
 #include "BKE_depsgraph.h"
 #include "BKE_DerivedMesh.h"
@@ -1377,7 +1378,7 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base,
 		ob->proxy = NULL;
 
 		ob->parent = NULL;
-		BLI_listbase_clear(&ob->constraints);
+		BKE_constraints_free(&ob->constraints);
 		ob->curve_cache = NULL;
 		ob->transflag &= ~OB_DUPLI;
 		ob->lay = base->lay;




More information about the Bf-blender-cvs mailing list