[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54569] trunk/blender/source/blender/ blenlib/intern/BLI_mempool.c: add debug check for mempool double free ( or misuse of BLI_MEMPOOL_ALLOW_ITER),
Campbell Barton
ideasman42 at gmail.com
Fri Feb 15 05:14:55 CET 2013
Revision: 54569
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54569
Author: campbellbarton
Date: 2013-02-15 04:14:53 +0000 (Fri, 15 Feb 2013)
Log Message:
-----------
add debug check for mempool double free (or misuse of BLI_MEMPOOL_ALLOW_ITER),
some reports in the tracker show errors on bmesh iteration which could be caused by this.
Modified Paths:
--------------
trunk/blender/source/blender/blenlib/intern/BLI_mempool.c
Modified: trunk/blender/source/blender/blenlib/intern/BLI_mempool.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/BLI_mempool.c 2013-02-14 23:50:30 UTC (rev 54568)
+++ trunk/blender/source/blender/blenlib/intern/BLI_mempool.c 2013-02-15 04:14:53 UTC (rev 54569)
@@ -245,6 +245,10 @@
BLI_freenode *newhead = addr;
if (pool->flag & BLI_MEMPOOL_ALLOW_ITER) {
+#ifndef NDEBUG
+ /* this will detect double free's */
+ BLI_assert(newhead->freeword != FREEWORD);
+#endif
newhead->freeword = FREEWORD;
}
More information about the Bf-blender-cvs
mailing list