fix for error freeing wrong num of MFace customdata when writing to legacy mesh format
authorCampbell Barton <ideasman42@gmail.com>
Tue, 17 Jan 2012 04:57:51 +0000 (04:57 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 17 Jan 2012 04:57:51 +0000 (04:57 +0000)
source/blender/blenloader/intern/writefile.c

index b621a740b669ee05d4951cbe97ef9220c67207b8..f41e9c91c8f3149e18aca626d71228a0b0798a2f 100644 (file)
@@ -1790,9 +1790,6 @@ static void write_meshs(WriteData *wd, ListBase *idbase)
 
                                /* restore */
                                mesh->mpoly = backup_mesh.mpoly;
-                               mesh->totface = backup_mesh.totface;
-                               mesh->totpoly = backup_mesh.totpoly;
-                               mesh->totloop = backup_mesh.totloop;
                                /* -- */
                                mesh->mface = backup_mesh.mface;
                                /* -- */
@@ -1804,6 +1801,10 @@ static void write_meshs(WriteData *wd, ListBase *idbase)
                                /* -- */
                                mesh->ldata= backup_mesh.ldata;
                                /* -- */
+                               mesh->totface = backup_mesh.totface;
+                               mesh->totpoly = backup_mesh.totpoly;
+                               mesh->totloop = backup_mesh.totloop;
+                               /* -- */
                                mesh_update_customdata_pointers(mesh, FALSE);
                                /* --*/
                                mesh->edit_btmesh = backup_mesh.edit_btmesh; /* keep this after updating custom pointers */