From 1677bde48027f13ed986a865951f3e94fe3499b7 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 13 Feb 2008 00:52:49 +0000 Subject: * Clean up the agent's asset transactions when it is removed from the scene * This may or may not help with the memory leak, need to assess --- .../Cache/AgentAssetTransactionsManager.cs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework/Communications') diff --git a/OpenSim/Framework/Communications/Cache/AgentAssetTransactionsManager.cs b/OpenSim/Framework/Communications/Cache/AgentAssetTransactionsManager.cs index 48b2563..82fe4c0 100644 --- a/OpenSim/Framework/Communications/Cache/AgentAssetTransactionsManager.cs +++ b/OpenSim/Framework/Communications/Cache/AgentAssetTransactionsManager.cs @@ -78,9 +78,24 @@ namespace OpenSim.Framework.Communications.Cache = new AgentAssetTransactions(userID, this, m_dumpAssetsToFile); AgentTransactions.Add(userID, transactions); } - } + + return AgentTransactions[userID]; + } + } + + /// + /// Remove the given agent asset transactions. This should be called when a client is departing + /// from a scene (and hence won't be making any more transactions here). + /// + /// + public void RemoveAgentAssetTransactions(LLUUID userID) + { + m_log.DebugFormat("Removing agent asset transactions structure for agent {0}", userID); - return AgentTransactions[userID]; + lock (AgentTransactions) + { + AgentTransactions.Remove(userID); + } } /// -- cgit v1.1