summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-29 18:23:07 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-29 18:26:49 +0300
commit1dca2012e1eb6083fc71c573c148e4c197a2bfad (patch)
treeccfb740d9fa2d24b3cf536071d4c39132a77e278 /src/resources
parent6afd82349bca7e8f5580057e3c1b9133e51c60c2 (diff)
downloadplus-1dca2012e1eb6083fc71c573c148e4c197a2bfad.tar.gz
plus-1dca2012e1eb6083fc71c573c148e4c197a2bfad.tar.bz2
plus-1dca2012e1eb6083fc71c573c148e4c197a2bfad.tar.xz
plus-1dca2012e1eb6083fc71c573c148e4c197a2bfad.zip
In memory usage tree not show 0 for child objects.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/memorymanager.cpp22
1 files changed, 16 insertions, 6 deletions
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)