From 1dca2012e1eb6083fc71c573c148e4c197a2bfad Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 29 Apr 2016 18:23:07 +0300 Subject: In memory usage tree not show 0 for child objects. --- src/resources/memorymanager.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'src/resources') diff --git a/src/resources/memorymanager.cpp b/src/resources/memorymanager.cpp index 2da7c0908..4a14a5e73 100644 --- a/src/resources/memorymanager.cpp +++ b/src/resources/memorymanager.cpp @@ -61,12 +61,22 @@ void MemoryManager::printMemory(const std::string &name, const int childsSum) { std::string str(level, ' '); - logger->log("%s%s: %d = %d + %d", - str.c_str(), - name.c_str(), - localSum + childsSum, - localSum, - childsSum); + if (childsSum > 0) + { + logger->log("%s%s: %d = %d + %d", + str.c_str(), + name.c_str(), + localSum + childsSum, + localSum, + childsSum); + } + else + { + logger->log("%s%s: %d", + str.c_str(), + name.c_str(), + localSum); + } } void MemoryManager::printAllMemory(ChatTab *const tab A_DYECMD_UNUSED) -- cgit v1.2.3-70-g09d2