[Bf-blender-cvs] [e66fc49] wiggly-widgets: Fix memory leak with loading facemap attached to bone

Julian Eisel noreply at git.blender.org
Wed Mar 9 15:45:14 CET 2016


Commit: e66fc4952bb00ab7700c366f43d76a87bd3b4f30
Author: Julian Eisel
Date:   Wed Mar 9 15:43:01 2016 +0100
Branches: wiggly-widgets
https://developer.blender.org/rBe66fc4952bb00ab7700c366f43d76a87bd3b4f30

Fix memory leak with loading facemap attached to bone

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

M	source/blender/blenloader/intern/readfile.c

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

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 2bfc49c..32802a0 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -3233,8 +3233,10 @@ static void lib_link_pose(FileData *fd, Main *bmain, Object *ob, bPose *pose)
 		
 		pchan->fmap_object = newlibadr_us(fd, arm->id.lib, pchan->fmap_object);
 		if (pchan->fmap_object) {
+			bFaceMap *fmap = fmap_find_name(pchan->fmap_object, pchan->fmap->name);
 			/* fix fmap pointer now that we've got updated fmap_object */
-			pchan->fmap = fmap_find_name(pchan->fmap_object, pchan->fmap->name);
+			MEM_freeN(pchan->fmap);
+			pchan->fmap = fmap;
 		}
 
 		pchan->custom = newlibadr_us(fd, arm->id.lib, pchan->custom);




More information about the Bf-blender-cvs mailing list