From 6a27f3fb207881c394bc6279fa941f9fd6a973ab Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 15 Jul 2020 05:15:32 +0100 Subject: [PATCH] useless changes --- OpenSim/Framework/Util.cs | 13 +++++++------ .../ServiceConnectorsOut/Asset/HGAssetBroker.cs | 5 +++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 2964d98d4b..480e32259c 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -3058,10 +3058,12 @@ namespace OpenSim.Framework { Interlocked.Decrement(ref numRunningThreadFuncs); threadInfo.Ended(); - ThreadInfo dummy; - activeThreads.TryRemove(threadFuncNum, out dummy); + activeThreads.TryRemove(threadFuncNum, out ThreadInfo dummy); if ((loggingEnabled || (threadFuncOverloadMode == 1)) && threadInfo.LogThread) m_log.DebugFormat("Exit threadfunc {0} ({1})", threadFuncNum, FormatDuration(threadInfo.Elapsed())); + callback = null; + o = null; + threadInfo = null; } }; } @@ -3083,10 +3085,10 @@ namespace OpenSim.Framework case FireAndForgetMethod.SmartThreadPool: if (m_ThreadPool == null) InitThreadPool(2, 15); - threadInfo.WorkItem = m_ThreadPool.QueueWorkItem((cb, o) => cb(o), realCallback, obj); + threadInfo.WorkItem = m_ThreadPool.QueueWorkItem((cb, o) => {cb(o); cb = null;}, realCallback, obj); break; case FireAndForgetMethod.Thread: - Thread thread = new Thread(delegate(object o) { realCallback(o); }); + Thread thread = new Thread(delegate(object o) { realCallback(o); realCallback = null;}); thread.Start(obj); break; default: @@ -3096,8 +3098,7 @@ namespace OpenSim.Framework catch (Exception) { Interlocked.Decrement(ref numQueuedThreadFuncs); - ThreadInfo dummy; - activeThreads.TryRemove(threadFuncNum, out dummy); + activeThreads.TryRemove(threadFuncNum, out ThreadInfo dummy); throw; } } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs index 92ae36fbb6..08468f470e 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs @@ -249,7 +249,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset public AssetMetadata GetMetadata(string id) { AssetBase asset = null; - if (m_Cache != null) { if (!m_Cache.Get(id, out asset)) @@ -301,7 +300,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset if (asset != null) { - Util.FireAndForget(delegate { handler(id, sender, asset); }, null, "HGAssetBroker.GotFromCache"); + Util.FireAndForget(delegate { handler(id, sender, asset); asset = null; }, null, "HGAssetBroker.GotFromCache"); return true; } @@ -312,6 +311,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset if (m_Cache != null) m_Cache.Cache(a); handler(assetID, s, a); + a = null; }); } else @@ -321,6 +321,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset if (m_Cache != null) m_Cache.Cache(a); handler(assetID, s, a); + a = null; }); } }