[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [44174] branches/bmesh/blender/source/ blender/editors/mesh/knifetool.c: fix [#30220] Knife Tool Crashes Blender

Campbell Barton ideasman42 at gmail.com
Fri Feb 17 03:06:42 CET 2012


Revision: 44174
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44174
Author:   campbellbarton
Date:     2012-02-17 02:06:30 +0000 (Fri, 17 Feb 2012)
Log Message:
-----------
fix [#30220] Knife Tool Crashes Blender

though there is still a memory leak, but it looks like the leak may be in BLI_smallhash.c, not knife code.

Modified Paths:
--------------
    branches/bmesh/blender/source/blender/editors/mesh/knifetool.c

Modified: branches/bmesh/blender/source/blender/editors/mesh/knifetool.c
===================================================================
--- branches/bmesh/blender/source/blender/editors/mesh/knifetool.c	2012-02-17 00:08:52 UTC (rev 44173)
+++ branches/bmesh/blender/source/blender/editors/mesh/knifetool.c	2012-02-17 02:06:30 UTC (rev 44174)
@@ -1698,8 +1698,7 @@
 	ListBase *face_nets = MEM_callocN(sizeof(ListBase)*bm->totface, "face_nets");
 	BMFace **faces = MEM_callocN(sizeof(BMFace *) * bm->totface, "faces knife");
 	MemArena *arena = BLI_memarena_new(1 << 16, "knifenet_fill_faces");
-	SmallHash shash, *hash = &shash;
-	/* SmallHash shash2, *visited = &shash2; */ /* UNUSED */
+	SmallHash shash;
 	int i, j, k = 0, totface = bm->totface;
 	
 	BMO_push(bm, NULL);
@@ -1800,6 +1799,7 @@
 	}
 	
 	for (i = 0; i < totface; i++) {
+		SmallHash *hash = &shash;
 		EditFace *efa;
 		EditVert *eve, *lasteve;
 		int j;
@@ -1932,7 +1932,6 @@
 	if (faces)
 		MEM_freeN(faces);
 	BLI_memarena_free(arena);
-	BLI_smallhash_release(hash);
 	
 	BMO_error_clear(bm); /* remerge_faces sometimes raises errors, so make sure to clear them */
 




More information about the Bf-blender-cvs mailing list