From f05f583613850ef480d7be6a74220da0507e8b9b Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Fri, 8 Feb 2008 22:39:08 +0000
Subject: Still chasing logout memory leak. Putting in small changes and
temporary light verbosity to this end
---
OpenSim/Region/ClientStack/ClientView.cs | 12 ++++++++++--
OpenSim/Region/ClientStack/PacketServer.cs | 12 +++++++++---
2 files changed, 19 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Region/ClientStack')
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index 363688f..6f25191 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -53,7 +53,7 @@ namespace OpenSim.Region.ClientStack
{
~ClientView()
{
- m_log.Info("[CLIENTVIEW]: Dstructor called");
+ System.Console.WriteLine("[CLIENTVIEW]: Destructor called");
}
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
@@ -237,6 +237,10 @@ namespace OpenSim.Region.ClientStack
private void CloseCleanup()
{
m_scene.RemoveClient(AgentId);
+
+ //m_log.Info(String.Format("[CLIENTVIEW] Memory pre GC {0}", System.GC.GetTotalMemory(false)));
+ //m_log.Info(String.Format("[CLIENTVIEW] Memory post GC {0}", System.GC.GetTotalMemory(true)));
+
// Send the STOP packet
DisableSimulatorPacket disable = (DisableSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.DisableSimulator);
OutPacket(disable, ThrottleOutPacketType.Task);
@@ -264,6 +268,11 @@ namespace OpenSim.Region.ClientStack
m_clientThread.Abort();
}
+ ///
+ /// Close down the client view. This *must* be the last method called, since the last #
+ /// statement of CloseCleanup() aborts the thread.
+ ///
+ ///
public void Close(bool ShutdownCircult)
{
// Pull Client out of Region
@@ -273,7 +282,6 @@ namespace OpenSim.Region.ClientStack
if (ShutdownCircult)
OnConnectionClosed(this);
-
CloseCleanup();
}
diff --git a/OpenSim/Region/ClientStack/PacketServer.cs b/OpenSim/Region/ClientStack/PacketServer.cs
index 9608ce5..7036de93 100644
--- a/OpenSim/Region/ClientStack/PacketServer.cs
+++ b/OpenSim/Region/ClientStack/PacketServer.cs
@@ -25,6 +25,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
+
+using System;
using System.Net;
using System.Net.Sockets;
using libsecondlife;
@@ -133,13 +135,17 @@ namespace OpenSim.Region.ClientStack
//m_scene.ClientManager.CloseAllAgents(circuitcode);
}
+ ///
+ /// Completely close down the given client.
+ ///
+ ///
public virtual void CloseClient(IClientAPI client)
{
- //m_log.Info("PacketServer:CloseClient()");
-
+ m_log.Info("PacketServer:CloseClient()");
+
CloseCircuit(client.CircuitCode);
+ m_scene.ClientManager.Remove(client.CircuitCode);
client.Close(false);
- m_scene.ClientManager.Remove(client.CircuitCode);
}
}
}
--
cgit v1.1