Explorar el Código

Collect unknown unfreed mallocs together

Kajetan Johannes Hammerle hace 4 meses
padre
commit
46accbad62
Se han modificado 1 ficheros con 9 adiciones y 1 borrados
  1. 9 1
      src/Utility.cpp

+ 9 - 1
src/Utility.cpp

@@ -176,8 +176,16 @@ void Core::debugDeallocateRaw(void* p) {
 }
 
 void Core::printMemoryReport() {
+    size_t counter = 0;
     for(MemoryInfo* i = headMemoryInfo; i != nullptr; i = i->next) {
-        LOG_ERROR("#:# was not freed", i->buffer, i->line);
+        if(i->line < 0) {
+            counter++;
+        } else {
+            LOG_ERROR("#:# was not freed", i->buffer, i->line);
+        }
+    }
+    if(counter > 0) {
+        LOG_ERROR("# unknown entries were not freed", counter);
     }
 }