aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/ServiceConnectorsOut
diff options
context:
space:
mode:
authorUbitUmarov2017-05-27 05:41:40 +0100
committerUbitUmarov2017-05-27 05:41:40 +0100
commit289d4ca128d278aed49044b92411234d5f57b781 (patch)
treeb9a10c96569d51102218e041fc3a018643fd230f /OpenSim/Region/CoreModules/ServiceConnectorsOut
parentlose a ref (diff)
downloadopensim-SC_OLD-289d4ca128d278aed49044b92411234d5f57b781.zip
opensim-SC_OLD-289d4ca128d278aed49044b92411234d5f57b781.tar.gz
opensim-SC_OLD-289d4ca128d278aed49044b92411234d5f57b781.tar.bz2
opensim-SC_OLD-289d4ca128d278aed49044b92411234d5f57b781.tar.xz
minor cleanup
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut')
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs34
1 files changed, 24 insertions, 10 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs
index 5d90b97..f3c2900 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs
@@ -429,6 +429,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
429 if(byuuid != null) 429 if(byuuid != null)
430 byuuid.Remove(r.RegionID); 430 byuuid.Remove(r.RegionID);
431 removeFromInner(r); 431 removeFromInner(r);
432 storage[handle] = null;
432 } 433 }
433 storage.Remove(handle); 434 storage.Remove(handle);
434 } 435 }
@@ -586,27 +587,32 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
586 { 587 {
587 if(expires == null || expires.Count == 0) 588 if(expires == null || expires.Count == 0)
588 return 0; 589 return 0;
589 590
591 int expiresCount = expires.Count;
590 List<ulong> toexpire = new List<ulong>(); 592 List<ulong> toexpire = new List<ulong>();
593
591 foreach(KeyValuePair<ulong, DateTime> kvp in expires) 594 foreach(KeyValuePair<ulong, DateTime> kvp in expires)
592 { 595 {
593 if(kvp.Value < now) 596 if(kvp.Value < now)
594 toexpire.Add(kvp.Key); 597 toexpire.Add(kvp.Key);
595 } 598 }
596 599
597 if(toexpire.Count == 0) 600 int toexpireCount = toexpire.Count;
598 return expires.Count; 601 if(toexpireCount == 0)
602 return expiresCount;
599 603
600 if(toexpire.Count == expires.Count) 604 if(toexpireCount == expiresCount)
601 { 605 {
602 Clear(); 606 Clear();
603 return 0; 607 return 0;
604 } 608 }
605 609
606 foreach(ulong h in toexpire) 610 if(storage != null)
607 { 611 {
608 if(storage != null) 612 ulong h;
613 for(int i = 0; i < toexpireCount; i++)
609 { 614 {
615 h = toexpire[i];
610 if(storage.ContainsKey(h)) 616 if(storage.ContainsKey(h))
611 { 617 {
612 GridRegion r = storage[h]; 618 GridRegion r = storage[h];
@@ -619,12 +625,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
619 storage[h] = null; 625 storage[h] = null;
620 storage.Remove(h); 626 storage.Remove(h);
621 } 627 }
628 if(expires != null)
629 expires.Remove(h);
622 } 630 }
623 if(expires != null) 631 }
624 expires.Remove(h); 632 else
633 {
634 Clear();
635 return 0;
625 } 636 }
626 637
627 if(expires.Count == 0) 638 if(expiresCount == 0)
628 { 639 {
629 byname = null; 640 byname = null;
630 byuuid = null; 641 byuuid = null;
@@ -633,7 +644,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
633 return 0; 644 return 0;
634 } 645 }
635 646
636 return expires.Count; 647 return expiresCount;
637 } 648 }
638 649
639 public int Count() 650 public int Count()
@@ -972,7 +983,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
972 if (expiredscopes.Count > 0) 983 if (expiredscopes.Count > 0)
973 { 984 {
974 foreach (UUID sid in expiredscopes) 985 foreach (UUID sid in expiredscopes)
986 {
987 InfobyScope[sid] = null;
975 InfobyScope.Remove(sid); 988 InfobyScope.Remove(sid);
989 }
976 } 990 }
977 } 991 }
978 finally { Monitor.Exit(syncRoot); } 992 finally { Monitor.Exit(syncRoot); }