Added check for memory leak inside destructor.

git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@533 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
rich_sposato 2006-02-14 18:20:21 +00:00
parent 87efaadca0
commit 74ea6b7209

View file

@ -555,6 +555,10 @@ FixedAllocator::FixedAllocator()
FixedAllocator::~FixedAllocator() FixedAllocator::~FixedAllocator()
{ {
#ifdef DO_EXTRA_LOKI_TESTS
TrimEmptyChunk();
assert( chunks_.empty() && "Memory leak detected!" );
#endif
for ( ChunkIter i( chunks_.begin() ); i != chunks_.end(); ++i ) for ( ChunkIter i( chunks_.begin() ); i != chunks_.end(); ++i )
i->Release(); i->Release();
} }
@ -1222,6 +1226,9 @@ bool SmallObjAllocator::IsCorrupt( void ) const
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// $Log$ // $Log$
// Revision 1.28 2006/02/14 18:20:21 rich_sposato
// Added check for memory leak inside destructor.
//
// Revision 1.27 2006/01/19 23:11:56 lfittl // Revision 1.27 2006/01/19 23:11:56 lfittl
// - Disabled -Weffc++ flag, fixing these warnings produces too much useless code // - Disabled -Weffc++ flag, fixing these warnings produces too much useless code
// - Enabled -pedantic, -Wold-style-cast and -Wundef for src/ and test/ // - Enabled -pedantic, -Wold-style-cast and -Wundef for src/ and test/