ManagedHeap::~ManagedHeap() { #ifdef ___INANITY_PLATFORM_WINDOWS // free all heap's memory HeapDestroy(heap); #endif #ifdef ___INANITY_TRACE_HEAP // create memory report Log::Message("======= INANITY MANAGED HEAP REPORT ======="); Log::Message("allocations: ", totalAllocationsCount, ", total size: ", totalAllocationsSize); if(allocations.size()) { std::ostringstream stream; PrintAllocations(stream); Log::Warning("ATTENTION! SOME LEAKS DETECTED!\n", stream.str()); } else Log::Message("NO LEAKS DETECTED"); #ifdef ___INANITY_TRACE_PTR if(!disableTracePtr) { std::ostringstream stream; PrintPtrs(stream); Log::Message("======= TRACE PTR REPORT =======\n", stream.str()); } #endif Log::Message("======= END REPORT ======="); #endif }
SINGEXPORT void memck_CheckMemLeaks (void) { PrintAllocations(); memck_ResetMemLeakDetection(); }