diff -r e24348a560a6 -r b72c6db6890b src/gui/util/qcompleter.cpp --- a/src/gui/util/qcompleter.cpp Fri Jun 11 14:24:45 2010 +0300 +++ b/src/gui/util/qcompleter.cpp Wed Jun 23 19:07:03 2010 +0300 @@ -527,17 +527,22 @@ QMatchData old = cache[parent].take(part); cost = cost + m.indices.cost() - old.indices.cost(); if (cost * sizeof(int) > 1024 * 1024) { - QMap::iterator it1 ; - for (it1 = cache.begin(); it1 != cache.end(); ++it1) { + QMap::iterator it1 = cache.begin(); + while (it1 != cache.end()) { CacheItem& ci = it1.value(); int sz = ci.count()/2; QMap::iterator it2 = ci.begin(); - for (int i = 0; it2 != ci.end() && i < sz; i++, ++it2) { + int i = 0; + while (it2 != ci.end() && i < sz) { cost -= it2.value().indices.cost(); - ci.erase(it2); + it2 = ci.erase(it2); + i++; } - if (ci.count() == 0) - cache.erase(it1); + if (ci.count() == 0) { + it1 = cache.erase(it1); + } else { + ++it1; + } } } @@ -1748,7 +1753,7 @@ This signal is sent when an item in the popup() is highlighted by the user. It is also sent if complete() is called with the completionMode() - set to QCOmpleter::InlineCompletion. The item's \a text is given. + set to QCompleter::InlineCompletion. The item's \a text is given. */ QT_END_NAMESPACE