aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs50
1 files changed, 23 insertions, 27 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
index 56d34e6..681562b 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
@@ -172,39 +172,39 @@ namespace OpenSim.Region.ClientStack.LindenUDP
172 J2KImage imagereq; 172 J2KImage imagereq;
173 int numCollected = 0; 173 int numCollected = 0;
174 174
175 //lock (m_syncRoot) 175 m_lastloopprocessed = DateTime.Now.Ticks;
176 //{ 176
177 m_lastloopprocessed = DateTime.Now.Ticks; 177 // This can happen during Close()
178 178 if (m_client == null)
179 // This can happen during Close() 179 return false;
180 if (m_client == null) 180
181 return false; 181 while ((imagereq = GetHighestPriorityImage()) != null)
182 182 {
183 while ((imagereq = GetHighestPriorityImage()) != null) 183 if (imagereq.IsDecoded == true)
184 { 184 {
185 if (imagereq.IsDecoded == true) 185 ++numCollected;
186 {
187 ++numCollected;
188 186
189 if (imagereq.SendPackets(m_client, maxpack)) 187 if (imagereq.SendPackets(m_client, maxpack))
190 { 188 {
191 // Send complete. Destroy any knowledge of this transfer 189 // Send complete. Destroy any knowledge of this transfer
192 RemoveImageFromQueue(imagereq); 190 RemoveImageFromQueue(imagereq);
193 }
194 } 191 }
195
196 if (numCollected == count)
197 break;
198 } 192 }
199 //} 193
194 if (numCollected == count)
195 break;
196 }
200 197
201 return m_priorityQueue.Count > 0; 198 return m_priorityQueue.Count > 0;
202 } 199 }
203 200
204 //Faux destructor 201 /// <summary>
202 /// Faux destructor
203 /// </summary>
205 public void Close() 204 public void Close()
206 { 205 {
207 m_shuttingdown = true; 206 m_shuttingdown = true;
207 m_priorityQueue = null;
208 m_j2kDecodeModule = null; 208 m_j2kDecodeModule = null;
209 m_assetCache = null; 209 m_assetCache = null;
210 m_client = null; 210 m_client = null;
@@ -218,13 +218,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
218 218
219 lock (m_syncRoot) 219 lock (m_syncRoot)
220 { 220 {
221
222 if (m_priorityQueue.Count > 0) 221 if (m_priorityQueue.Count > 0)
223 { 222 {
224 try 223 try { image = m_priorityQueue.FindMax(); }
225 {
226 image = m_priorityQueue.FindMax();
227 }
228 catch (Exception) { } 224 catch (Exception) { }
229 } 225 }
230 } 226 }