following on from last commit r36263.

copying metaball, lattice and armature datablocks while in editmode could segfault when they were freed, NULL these pointers on copy.
This commit is contained in:
Campbell Barton
2011-04-21 09:38:09 +00:00
parent 62a02764ab
commit 20d3022076
4 changed files with 12 additions and 1 deletions

View File

@@ -214,6 +214,11 @@ bArmature *copy_armature(bArmature *arm)
};
newArm->act_bone= newActBone;
newArm->edbo= NULL;
newArm->act_edbone= NULL;
newArm->sketch= NULL;
return newArm;
}

View File

@@ -201,6 +201,7 @@ Curve *copy_curve(Curve *cu)
cun->editnurb= NULL;
cun->editfont= NULL;
cun->selboxes= NULL;
#if 0 // XXX old animation system
/* single user ipo too */

View File

@@ -219,7 +219,9 @@ Lattice *copy_lattice(Lattice *lt)
ltn->dvert = MEM_mallocN (sizeof (MDeformVert)*tot, "Lattice MDeformVert");
copy_dverts(ltn->dvert, lt->dvert, tot);
}
ltn->editlatt= NULL;
return ltn;
}

View File

@@ -132,6 +132,9 @@ MetaBall *copy_mball(MetaBall *mb)
id_us_plus((ID *)mbn->mat[a]);
}
mbn->bb= MEM_dupallocN(mb->bb);
mbn->editelems= NULL;
mbn->lastelem= NULL;
return mbn;
}