From f6a34da65b068fd151c17b5b2dc6276280afdd28 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 18 Sep 2014 20:28:25 +0000 Subject: Add check for tracking the same memory block twice --- lib/common/DebugMemLeakFinder.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/common/DebugMemLeakFinder.cpp') diff --git a/lib/common/DebugMemLeakFinder.cpp b/lib/common/DebugMemLeakFinder.cpp index 30b2f41f..a7d87528 100644 --- a/lib/common/DebugMemLeakFinder.cpp +++ b/lib/common/DebugMemLeakFinder.cpp @@ -609,6 +609,10 @@ void add_object_block(void *block, size_t size, const char *file, int line, bool if(block != 0) { + std::map::iterator j(sObjectBlocks.find(block)); + // The same block should not already be tracked! + ASSERT(j == sObjectBlocks.end()); + ObjectInfo i; i.size = size; i.file = file; -- cgit v1.2.3