From 2be362bd6759bc1f6b87703ad32f235c27d97c9a Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 26 May 2017 21:30:06 +0100 Subject: [PATCH] lose a ref --- .../Grid/RegionInfoCache.cs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs index 84e52f7602..5d90b97061 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs @@ -385,7 +385,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid storage[handle] = region; byname[region.RegionName] = handle; byuuid[region.RegionID] = handle; - } public void Remove(GridRegion region) @@ -400,7 +399,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid ulong handle = region.RegionHandle & HANDLEMASK; if(storage != null) - storage.Remove(handle); + { + if(storage.ContainsKey(handle)) + { + storage[handle] = null; + storage.Remove(handle); + } + } removeFromInner(region); if(expires != null) { @@ -610,8 +615,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid if(byuuid != null) byuuid.Remove(r.RegionID); removeFromInner(r); + + storage[h] = null; + storage.Remove(h); } - storage.Remove(h); } if(expires != null) expires.Remove(h); @@ -693,7 +700,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid public class RegionsExpiringCache { - const double CACHE_PURGE_HZ = 60; // seconds + const double CACHE_PURGE_TIME = 60000; // milliseconds const int MAX_LOCK_WAIT = 10000; // milliseconds /// For thread safety @@ -702,7 +709,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid object isPurging = new object(); Dictionary InfobyScope = new Dictionary(); - private System.Timers.Timer timer = new System.Timers.Timer(TimeSpan.FromSeconds(CACHE_PURGE_HZ).TotalMilliseconds); + private System.Timers.Timer timer = new System.Timers.Timer(CACHE_PURGE_TIME); public RegionsExpiringCache() {