diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:18:53 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:18:53 +0200 |
commit | 32cb97237e7691d31977ab503c6ea4511e8eb3a8 (patch) | |
tree | 4e97b53e9f7b74e8cc5d7548507d9e82ae38e36f /zen/zstring.cpp | |
parent | 4.6 (diff) | |
download | FreeFileSync-32cb97237e7691d31977ab503c6ea4511e8eb3a8.tar.gz FreeFileSync-32cb97237e7691d31977ab503c6ea4511e8eb3a8.tar.bz2 FreeFileSync-32cb97237e7691d31977ab503c6ea4511e8eb3a8.zip |
5.0
Diffstat (limited to 'zen/zstring.cpp')
-rw-r--r-- | zen/zstring.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/zen/zstring.cpp b/zen/zstring.cpp index 38d9b4c4..d17e860c 100644 --- a/zen/zstring.cpp +++ b/zen/zstring.cpp @@ -1,7 +1,7 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * +// * Copyright (C) ZenJu (zhnmju123 AT gmx DOT de) - All Rights Reserved * // ************************************************************************** #include "zstring.h" @@ -24,15 +24,13 @@ using namespace zen; #ifndef NDEBUG LeakChecker::~LeakChecker() { - if (activeStrings.size() > 0) + if (!activeStrings.empty()) { - int rowCount = 0; std::string leakingStrings; - for (VoidPtrSizeMap::const_iterator i = activeStrings.begin(); - i != activeStrings.end() && ++rowCount <= 20; - ++i) - leakingStrings += "\"" + rawMemToString(i->first, i->second) + "\"\n"; + int items = 0; + for (auto iter = activeStrings.begin(); iter != activeStrings.end() && items < 20; ++iter, ++items) + leakingStrings += "\"" + rawMemToString(iter->first, iter->second) + "\"\n"; const std::string message = std::string("Memory leak detected!") + "\n\n" + "Candidates:\n" + leakingStrings; |