diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-07-18 17:05:15 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-07-18 17:05:15 +0400 |
commit | 6786c517af25234de320fc459252390e4454d85f (patch) | |
tree | 2ab710e8a767fd18004693e99017e1449ca48be9 | |
parent | c216c980d3494b3a7884bc2d0d033002a2e2d0cb (diff) |
own error, recent commit that tried to keep an active face could crash when deleting faces.
-rw-r--r-- | source/blender/src/editmesh.c | 7 | ||||
-rw-r--r-- | source/blender/src/editmesh_lib.c | 7 |
2 files changed, 5 insertions, 9 deletions
diff --git a/source/blender/src/editmesh.c b/source/blender/src/editmesh.c index 2b12b16a299..188f7476728 100644 --- a/source/blender/src/editmesh.c +++ b/source/blender/src/editmesh.c @@ -340,8 +340,9 @@ void free_editface(EditFace *efa) #endif EM_remove_selection(efa, EDITFACE); - if (G.editMesh->act_face==efa) - EM_set_actFace(NULL); + if (G.editMesh->act_face==efa) { + EM_set_actFace( G.editMesh->faces.first == efa ? NULL : G.editMesh->faces.first); + } CustomData_em_free_block(&G.editMesh->fdata, &efa->data); if(efa->fast==0) @@ -1061,7 +1062,7 @@ void make_editMesh() EM_fgon_flags(); if (EM_get_actFace(0)==NULL) { - EM_set_actFace(NULL); /* will use the first face, this is so we alwats have an active face */ + EM_set_actFace( G.editMesh->faces.first ); /* will use the first face, this is so we alwats have an active face */ } /* vertex coordinates change with cache edit, need to recalc */ diff --git a/source/blender/src/editmesh_lib.c b/source/blender/src/editmesh_lib.c index 2b0b1e110c6..4d9679b6b8a 100644 --- a/source/blender/src/editmesh_lib.c +++ b/source/blender/src/editmesh_lib.c @@ -72,12 +72,7 @@ editmesh_lib: generic (no UI, no menus) operations/evaluators for editmesh data /* this replaces the active flag used in uv/face mode */ void EM_set_actFace(EditFace *efa) { - if (efa) { - G.editMesh->act_face = efa; - } else { - /* True or NULL if we have no faces, so we always have an active face */ - G.editMesh->act_face = G.editMesh->faces.first; - } + G.editMesh->act_face = efa; } EditFace * EM_get_actFace(int sloppy) |