Fix segmentation fault when try separate a mesh with the active face selected.

If the active face is part of the selection, Blender crash when
split the mesh because the act_face have an invalid pointer.

The solution is simple, check if the active face is part of the selection
and in that case, set it to NULL.

Campbell please double check this.
This commit is contained in:
Diego Borghetti 2008-09-02 17:50:54 +00:00
parent ead69661e8
commit dcbf8fbf76

@ -1683,6 +1683,10 @@ void separate_mesh(void)
efa= em->faces.first;
while(efa) {
vl1= efa->next;
if (efa == G.editMesh->act_face && (efa->f & SELECT)) {
EM_set_actFace(NULL);
}
if((efa->f & SELECT)==0) {
BLI_remlink(&em->faces, efa);
BLI_addtail(&edvl, efa);