diff options
Diffstat (limited to 'OpenSim/Framework/Communications/Cache/AssetCache.cs')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/AssetCache.cs | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index 3e60ceb..5bc388a 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs | |||
@@ -81,6 +81,9 @@ namespace OpenSim.Framework.Communications.Cache | |||
81 | long imageBytes = 0; | 81 | long imageBytes = 0; |
82 | long assetBytes = 0; | 82 | long assetBytes = 0; |
83 | 83 | ||
84 | |||
85 | |||
86 | |||
84 | foreach (TextureImage texture in Textures.Values) | 87 | foreach (TextureImage texture in Textures.Values) |
85 | { | 88 | { |
86 | if (texture.Temporary) | 89 | if (texture.Temporary) |
@@ -201,22 +204,23 @@ namespace OpenSim.Framework.Communications.Cache | |||
201 | else | 204 | else |
202 | { | 205 | { |
203 | NewAssetRequest req = new NewAssetRequest(assetID, callback); | 206 | NewAssetRequest req = new NewAssetRequest(assetID, callback); |
204 | if (RequestLists.ContainsKey(assetID)) | 207 | |
208 | AssetRequestsList requestList; | ||
209 | |||
210 | lock (RequestLists) | ||
205 | { | 211 | { |
206 | lock (RequestLists) | 212 | if (RequestLists.TryGetValue(assetID, out requestList)) |
207 | { | 213 | { |
208 | RequestLists[assetID].Requests.Add(req); | ||
209 | } | 214 | } |
210 | } | 215 | else |
211 | else | ||
212 | { | ||
213 | AssetRequestsList reqList = new AssetRequestsList(assetID); | ||
214 | reqList.Requests.Add(req); | ||
215 | lock (RequestLists) | ||
216 | { | 216 | { |
217 | RequestLists.Add(assetID, reqList); | 217 | requestList = new AssetRequestsList(assetID); |
218 | RequestLists.Add(assetID, requestList); | ||
218 | } | 219 | } |
219 | } | 220 | } |
221 | |||
222 | requestList.Requests.Add(req); | ||
223 | |||
220 | m_assetServer.RequestAsset(assetID, false); | 224 | m_assetServer.RequestAsset(assetID, false); |
221 | } | 225 | } |
222 | } | 226 | } |