From 7a71f58af3b5f70e8982d827d1fef7e8bc4e4ec8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 14 Sep 2012 06:17:14 +0000 Subject: fixes for NULL checks, remove some redundant checks and add some in that have been removed by accident as code has been updated. --- source/blender/editors/armature/poseobject.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'source/blender/editors/armature') diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index e4f1e6d3e8b..e9424a08b0c 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -2350,20 +2350,18 @@ static int pose_clear_user_transforms_exec(bContext *C, wmOperator *op) for (pchan = dummyPose->chanbase.first; pchan; pchan = pchan->next) { pose_bone_do_paste(ob, pchan, only_select, 0); } - + /* free temp data - free manually as was copied without constraints */ - if (dummyPose) { - for (pchan = dummyPose->chanbase.first; pchan; pchan = pchan->next) { - if (pchan->prop) { - IDP_FreeProperty(pchan->prop); - MEM_freeN(pchan->prop); - } + for (pchan = dummyPose->chanbase.first; pchan; pchan = pchan->next) { + if (pchan->prop) { + IDP_FreeProperty(pchan->prop); + MEM_freeN(pchan->prop); } - - /* was copied without constraints */ - BLI_freelistN(&dummyPose->chanbase); - MEM_freeN(dummyPose); } + + /* was copied without constraints */ + BLI_freelistN(&dummyPose->chanbase); + MEM_freeN(dummyPose); } else { /* no animation, so just reset whole pose to rest pose -- cgit v1.2.3