diff options
author | Chris Wilson <chris+github@qwirx.com> | 2014-09-18 20:28:25 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2014-09-18 20:28:25 +0000 |
commit | f6a34da65b068fd151c17b5b2dc6276280afdd28 (patch) | |
tree | 36b86e46748c8cbd2556e3f236c5c149a81427be /lib/common/DebugMemLeakFinder.cpp | |
parent | 572b5bd9dee50dd1c90042f476a8c888732cfa1f (diff) |
Add check for tracking the same memory block twice
Diffstat (limited to 'lib/common/DebugMemLeakFinder.cpp')
-rw-r--r-- | lib/common/DebugMemLeakFinder.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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<void *, ObjectInfo>::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; |