Fix bug #1466: Crash on decimating non-manifold mesh in scons build.
- Enabled the NDEBUG define (to disable assertions) on all platforms in scons. This is already the default in Makefiles. - Free MEdge data after decimating, it is not valid anymore.
This commit is contained in:
@@ -207,8 +207,8 @@ static void decimate_faces(void)
|
||||
me= ob->data;
|
||||
|
||||
/* add warning for vertex col and tfaces */
|
||||
if(me->tface || me->mcol || me->dvert) {
|
||||
if(okee("This will remove UV coordinates, vertexcolors, and deform weights")==0) return;
|
||||
if(me->tface || me->mcol || me->dvert || me->medge) {
|
||||
if(okee("This will remove UV coordinates, vertexcolors, deform weights and edge data")==0) return;
|
||||
if(me->tface) MEM_freeN(me->tface);
|
||||
if(me->mcol) MEM_freeN(me->mcol);
|
||||
if(me->dvert) free_dverts(me->dvert, me->totvert);
|
||||
@@ -348,6 +348,11 @@ static void decimate_apply(void)
|
||||
dlm->mvert= NULL;
|
||||
me->totvert= dlm->totvert;
|
||||
|
||||
// edges
|
||||
if(me->medge) MEM_freeN(me->medge);
|
||||
me->medge = NULL;
|
||||
me->totedge = 0;
|
||||
|
||||
// faces
|
||||
if(me->mface) MEM_freeN(me->mface);
|
||||
me->mface= MEM_callocN(dlm->totface*sizeof(MFace), "mface");
|
||||
|
||||
Reference in New Issue
Block a user