Two little fixes in administrating new Mesh edges. Solves crash when

joining newly created (Added) Mesh with others...
This commit is contained in:
Ton Roosendaal
2004-07-09 08:15:57 +00:00
parent f77bc7eb7d
commit ec64e0d743
2 changed files with 5 additions and 2 deletions

View 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;

View 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;