Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-02-15 08:14:53 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-02-15 08:14:53 +0400
commitf46ca7836d10fa05d589faa346eac42358893f1e (patch)
tree9b7194d7f8bec4e8cf66b2e71390d91e6699fe07 /source/blender/blenlib/intern/BLI_mempool.c
parentc6b3e0f8e466cfe3c2e31173b4c7e4399d2dc23f (diff)
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.
Diffstat (limited to 'source/blender/blenlib/intern/BLI_mempool.c')
-rw-r--r--source/blender/blenlib/intern/BLI_mempool.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/BLI_mempool.c b/source/blender/blenlib/intern/BLI_mempool.c
index bf228f7456a..7670b057a7f 100644
--- a/source/blender/blenlib/intern/BLI_mempool.c
+++ b/source/blender/blenlib/intern/BLI_mempool.c
@@ -245,6 +245,10 @@ void BLI_mempool_free(BLI_mempool *pool, void *addr)
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;
}