Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-11-21 14:26:09 +0300
committerCampbell Barton <ideasman42@gmail.com>2009-11-21 14:26:09 +0300
commit684405e0fb80216dbafbe4dcea3cd21cc18c17c9 (patch)
tree0c5e5f92db6d123d38dcd3827fc37d3050807edf /source/blender/editors/armature
parent6073bc9bc3f935e4018fd0cc1fc3d2b1db6fc0b6 (diff)
id properties for editbones and pose channels were not being freed in a number of cases,
added free_pose_channel(pchan) and use this in all places that free pose bones
Diffstat (limited to 'source/blender/editors/armature')
-rw-r--r--source/blender/editors/armature/editarmature.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index 320be365631..8c858536fc5 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -144,6 +144,11 @@ void free_edit_bone(bArmature *arm, EditBone *bone)
if(arm->act_edbone==bone)
arm->act_edbone= NULL;
+ if(bone->prop) {
+ IDP_FreeProperty(bone->prop);
+ MEM_freeN(bone->prop);
+ }
+
BLI_freelinkN(arm->edbo, bone);
}
@@ -1025,8 +1030,7 @@ static void separate_armature_bones (Scene *scene, Object *ob, short sel)
}
/* free any of the extra-data this pchan might have */
- if (pchan->path) MEM_freeN(pchan->path);
- free_constraints(&pchan->constraints);
+ free_pose_channel(pchan);
/* get rid of unneeded bone */
free_edit_bone(arm, curbone);
@@ -1733,17 +1737,17 @@ static int armature_delete_selected_exec(bContext *C, wmOperator *op)
/* First erase any associated pose channel */
if (obedit->pose) {
- bPoseChannel *chan, *next;
- for (chan=obedit->pose->chanbase.first; chan; chan=next) {
- next= chan->next;
- curBone = editbone_name_exists(arm->edbo, chan->name);
+ bPoseChannel *pchan, *next;
+ for (pchan=obedit->pose->chanbase.first; pchan; pchan=next) {
+ next= pchan->next;
+ curBone = editbone_name_exists(arm->edbo, pchan->name);
if (curBone && (curBone->flag & BONE_SELECTED) && (arm->layer & curBone->layer)) {
- free_constraints(&chan->constraints);
- BLI_freelinkN (&obedit->pose->chanbase, chan);
+ free_pose_channel(pchan);
+ BLI_freelinkN (&obedit->pose->chanbase, pchan);
}
else {
- for (con= chan->constraints.first; con; con= con->next) {
+ for (con= pchan->constraints.first; con; con= con->next) {
bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
ListBase targets = {NULL, NULL};
bConstraintTarget *ct;
@@ -2522,12 +2526,12 @@ void updateDuplicateSubtargetObjects(EditBone *dupBone, ListBase *editbones, Obj
* they point to has also been duplicated
*/
EditBone *oldtarget, *newtarget;
- bPoseChannel *chan;
+ bPoseChannel *pchan;
bConstraint *curcon;
ListBase *conlist;
- if ( (chan = verify_pose_channel(dst_ob->pose, dupBone->name)) ) {
- if ( (conlist = &chan->constraints) ) {
+ if ( (pchan = verify_pose_channel(dst_ob->pose, dupBone->name)) ) {
+ if ( (conlist = &pchan->constraints) ) {
for (curcon = conlist->first; curcon; curcon=curcon->next) {
/* does this constraint have a subtarget in
* this armature?