fix [#27266] EdgeSplit + RemoveDoubles + MoveView = Crash
authorCampbell Barton <ideasman42@gmail.com>
Tue, 3 May 2011 04:18:23 +0000 (04:18 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 3 May 2011 04:18:23 +0000 (04:18 +0000)
source/blender/editors/mesh/editmesh_mods.c
source/blender/editors/mesh/editmesh_tools.c

index 5ad4f8f274fdf0783ea74fb3cdf8392795a21bd7..8cdbe6707a323f98d7285e48947f69c12f35ab78 100644 (file)
@@ -143,9 +143,10 @@ void EM_automerge(Scene *scene, Object *obedit, int update)
                (obedit && obedit->type==OB_MESH && (obedit->mode & OB_MODE_EDIT))
          ) {
                EditMesh *em= me->edit_mesh;
+               int totvert= em->totvert, totedge= em->totedge, totface= em->totface;
 
                len = removedoublesflag(em, 1, 1, scene->toolsettings->doublimit);
-               if (len) {
+               if (totvert != em->totvert || totedge != em->totedge || totface != em->totface) {
                        if (update) {
                                DAG_id_tag_update(&me->id, 0);
                        }
index a66c72bf329097175b6186c5710f7aa956c0917a..a78029da0790baec7deea4dc7b63d4cecb502908 100644 (file)
@@ -483,10 +483,11 @@ static int removedoublesflag_exec(bContext *C, wmOperator *op)
 {
        Object *obedit= CTX_data_edit_object(C);
        EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data));
+       int totvert= em->totvert, totedge= em->totedge, totface= em->totface;
 
        int count = removedoublesflag(em,1,0,RNA_float_get(op->ptr, "limit"));
        
-       if(count) {
+       if (totvert != em->totvert || totedge != em->totedge || totface != em->totface) {
                recalc_editnormals(em);
 
                DAG_id_tag_update(obedit->data, 0);
@@ -5919,6 +5920,7 @@ static int merge_exec(bContext *C, wmOperator *op)
        EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data);
        int count= 0, uvs= RNA_boolean_get(op->ptr, "uvs");
        EditSelection *ese;
+       int totvert= em->totvert, totedge= em->totedge, totface= em->totface;
 
        switch(RNA_enum_get(op->ptr, "type")) {
                case 3:
@@ -5949,7 +5951,7 @@ static int merge_exec(bContext *C, wmOperator *op)
                        break;
        }
 
-       if(!count)
+       if (!(totvert != em->totvert || totedge != em->totedge || totface != em->totface))
                return OPERATOR_CANCELLED;
 
        recalc_editnormals(em);