[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [44175] branches/bmesh/blender/source/ blender: fix [#30220] Knife Tool Leaks memory

Campbell Barton ideasman42 at gmail.com
Fri Feb 17 06:33:41 CET 2012


Revision: 44175
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44175
Author:   campbellbarton
Date:     2012-02-17 05:33:23 +0000 (Fri, 17 Feb 2012)
Log Message:
-----------
fix [#30220] Knife Tool Leaks memory

both crash and leak are fixed now.

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

Modified: branches/bmesh/blender/source/blender/blenlib/intern/smallhash.c
===================================================================
--- branches/bmesh/blender/source/blender/blenlib/intern/smallhash.c	2012-02-17 02:06:30 UTC (rev 44174)
+++ branches/bmesh/blender/source/blender/blenlib/intern/smallhash.c	2012-02-17 05:33:23 UTC (rev 44175)
@@ -88,7 +88,7 @@
 		int i = 0;
 
 		if (hash->table != hash->stacktable || newsize > SMSTACKSIZE) {
-			tmp = MEM_callocN(sizeof(*hash->table) * newsize, "new hashkeys");
+			tmp = MEM_callocN(sizeof(*hash->table) * newsize, __func__);
 		}
 		else {
 			SWAP(SmallHashEntry *, hash->stacktable, hash->copytable);

Modified: branches/bmesh/blender/source/blender/editors/mesh/knifetool.c
===================================================================
--- branches/bmesh/blender/source/blender/editors/mesh/knifetool.c	2012-02-17 02:06:30 UTC (rev 44174)
+++ branches/bmesh/blender/source/blender/editors/mesh/knifetool.c	2012-02-17 05:33:23 UTC (rev 44175)
@@ -1680,6 +1680,8 @@
 	/* bm->elem_index_dirty &= ~BM_FACE; */
 	bm->elem_index_dirty |= BM_FACE;
 
+	BLI_smallhash_release(visit);
+
 	BLI_array_free(stack);
 	BLI_array_free(faces);
 }




More information about the Bf-blender-cvs mailing list