fix [#34098] Crash after using Decimate or Remesh modifiers
authorCampbell Barton <ideasman42@gmail.com>
Mon, 4 Feb 2013 11:28:31 +0000 (11:28 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 4 Feb 2013 11:28:31 +0000 (11:28 +0000)
converting a derived mesh to a mesh didnt clear its selection history, which could be invalid after applying a modifier.

source/blender/blenkernel/intern/DerivedMesh.c

index 8ca6d0457129124c9e92c8b1e61e709b72df31dd..8e740075bc64a2cf9f0203fb7e2ccc9e55982c2a 100644 (file)
@@ -562,6 +562,13 @@ void DM_to_mesh(DerivedMesh *dm, Mesh *me, Object *ob)
                tmp.key = NULL;
        }
 
+       /* Clear selection history */
+       tmp.mselect = NULL;
+       tmp.totselect = 0;
+       if (me->mselect) {
+               MEM_freeN(me->mselect);
+       }
+
        *me = tmp;
 }