From 38a0dbf04f24fc22f504485cdcd1efb274fc9a46 Mon Sep 17 00:00:00 2001 From: Paul ProductEngine Date: Fri, 15 Apr 2011 18:50:03 +0300 Subject: STORM-1039 FIXED Bad iterator access in llavatarnamecache.cpp:564 - Replaced 'while' loop by 'for' - Deleted unnecessary 'cur' iterator --- indra/llmessage/llavatarnamecache.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'indra/llmessage') diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index 767001b633..33e6709983 100644 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -553,12 +553,10 @@ void LLAvatarNameCache::eraseUnrefreshed() if (!sLastExpireCheck || sLastExpireCheck < max_unrefreshed) { sLastExpireCheck = now; - cache_t::iterator it = sCache.begin(); - while (it != sCache.end()) + + for (cache_t::iterator it = sCache.begin(); it != sCache.end(); ++it) { - cache_t::iterator cur = it; - ++it; - const LLAvatarName& av_name = cur->second; + const LLAvatarName& av_name = it->second; if (av_name.mExpires < max_unrefreshed) { const LLUUID& agent_id = it->first; @@ -566,7 +564,7 @@ void LLAvatarNameCache::eraseUnrefreshed() << " user '" << av_name.mUsername << "' " << "expired " << now - av_name.mExpires << " secs ago" << LL_ENDL; - sCache.erase(cur); + sCache.erase(it); } } LL_INFOS("AvNameCache") << sCache.size() << " cached avatar names" << LL_ENDL; -- cgit v1.2.3