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:
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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 */
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user