diff options
Diffstat (limited to 'indra/llmessage')
| -rw-r--r-- | indra/llmessage/llassetstorage.cpp | 23 | ||||
| -rw-r--r-- | indra/llmessage/llavatarnamecache.cpp | 14 | 
2 files changed, 28 insertions, 9 deletions
| diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp index 27a368df3d..69d092de76 100644 --- a/indra/llmessage/llassetstorage.cpp +++ b/indra/llmessage/llassetstorage.cpp @@ -398,6 +398,12 @@ BOOL LLAssetStorage::hasLocalAsset(const LLUUID &uuid, const LLAssetType::EType  bool LLAssetStorage::findInStaticVFSAndInvokeCallback(const LLUUID& uuid, LLAssetType::EType type,  													  LLGetAssetCallback callback, void *user_data)  { +	if (user_data) +	{ +		// The *user_data should not be passed without a callback to clean it up. +		llassert(callback != NULL) +	} +  	BOOL exists = mStaticVFS->getExists(uuid, type);  	if (exists)  	{ @@ -432,15 +438,26 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LL  	llinfos << "ASSET_TRACE requesting " << uuid << " type " << LLAssetType::lookup(type) << llendl; +	if (user_data) +	{ +		// The *user_data should not be passed without a callback to clean it up. +		llassert(callback != NULL) +	} +  	if (mShutDown)  	{  		llinfos << "ASSET_TRACE cancelled " << uuid << " type " << LLAssetType::lookup(type) << " shutting down" << llendl; -		return; // don't get the asset or do any callbacks, we are shutting down + +		if (callback) +		{ +			callback(mVFS, uuid, type, user_data, LL_ERR_ASSET_REQUEST_FAILED, LL_EXSTAT_NONE); +		} +		return;  	} -		 +  	if (uuid.isNull())  	{ -		// Special case early out for NULL uuid +		// Special case early out for NULL uuid and for shutting down  		if (callback)  		{  			callback(mVFS, uuid, type, user_data, LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE, LL_EXSTAT_NULL_UUID); diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index 767001b633..97f2792686 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();)          { -            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,8 +564,12 @@ void LLAvatarNameCache::eraseUnrefreshed()                                           << " user '" << av_name.mUsername << "' "                                           << "expired " << now - av_name.mExpires << " secs ago"                                           << LL_ENDL; -                sCache.erase(cur); +                sCache.erase(it++);              } +			else +			{ +				++it; +			}          }          LL_INFOS("AvNameCache") << sCache.size() << " cached avatar names" << LL_ENDL;  	} | 
