From 268d2ffe8b533890b408740db1a6a3730dfd8597 Mon Sep 17 00:00:00 2001 From: Tannin Date: Sun, 17 May 2015 14:03:01 +0200 Subject: - some code cleanup and modernization trying to fix "dr memory" reports (though they were almost certainly false positives) - there is now a 50ms timeout on logging messages - bugfix: leaked handles after directory searches --- src/modinfo.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/modinfo.cpp') diff --git a/src/modinfo.cpp b/src/modinfo.cpp index 923ad855..bbc72c72 100644 --- a/src/modinfo.cpp +++ b/src/modinfo.cpp @@ -277,11 +277,10 @@ int ModInfo::checkAllForUpdate(QObject *receiver) modIDs.push_back(GameInfo::instance().getNexusModID()); - for (std::vector::iterator iter = s_Collection.begin(); - iter != s_Collection.end(); ++iter) { - if ((*iter)->canBeUpdated()) { - modIDs.push_back((*iter)->getNexusID()); - if (modIDs.size() >= 255) { + for (const ModInfo::Ptr &mod : s_Collection) { + if (mod->canBeUpdated()) { + modIDs.push_back(mod->getNexusID()); + if (modIDs.size() >= chunkSize) { checkChunkForUpdate(modIDs, receiver); modIDs.clear(); } -- cgit v1.3.1