Explorar o código

Change assert message to include both missing deallocations and leak in bytes

Daniele Bartolini %!s(int64=12) %!d(string=hai) anos
pai
achega
6907ccb742
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      src/core/mem/MallocAllocator.cpp

+ 2 - 2
src/core/mem/MallocAllocator.cpp

@@ -41,8 +41,8 @@ MallocAllocator::MallocAllocator() :
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 MallocAllocator::~MallocAllocator()
 MallocAllocator::~MallocAllocator()
 {
 {
-	CE_ASSERT(m_allocation_count == 0, "Missing %d deallocations", m_allocation_count);
-	CE_ASSERT(m_allocated_size == 0, "Memory leak of %d bytes", m_allocated_size);
+	CE_ASSERT(m_allocation_count == 0 && allocated_size() == 0,
+		"Missing %d deallocations causing a leak of %d bytes", m_allocation_count, allocated_size());
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------