Two little fixes in administrating new Mesh edges. Solves crash when
authorTon Roosendaal <ton@blender.org>
Fri, 9 Jul 2004 08:15:57 +0000 (08:15 +0000)
committerTon Roosendaal <ton@blender.org>
Fri, 9 Jul 2004 08:15:57 +0000 (08:15 +0000)
joining newly created (Added) Mesh with others...

source/blender/src/buttons_editing.c
source/blender/src/editmesh.c

index ab811055f20305c9fe1b811c4308a1417ec917a5..33021c7d17f6d702f7c1aff0dfe6aa41f0177a00 100644 (file)
@@ -1840,7 +1840,10 @@ void do_meshbuts(unsigned short event)
                
                case B_MAKEEDGES:
                        /* in editmode we only have to set edge pointer */
-                       if(ob==G.obedit) me->medge= MEM_callocN(sizeof(MEdge), "fake mesh edge");
+                       if(ob==G.obedit) {
+                               me->medge= MEM_callocN(sizeof(MEdge), "fake mesh edge");
+                               me->totedge= 1;
+                       }
                        else make_edges(me);
                        allqueue(REDRAWBUTSEDIT, 0);
                        break;
index f3b797ba8ffd0a46921d4c73cc7dd924e0d709a4..3c7eedb141c67f5ebd83f022397136f7344a86d8 100644 (file)
@@ -1275,7 +1275,7 @@ void load_editMesh_real(Mesh *me, int undo)
 
        if(me->medge) MEM_freeN(me->medge);
        me->medge= medge;
-       me->totedge= totedge;
+       if(medge) me->totedge= totedge; else me->totedge= 0;
        
        if(me->mface) MEM_freeN(me->mface);
        me->mface= mface;