From fb2a1a6b7cc65352644921bc7c7b7745ca7d2560 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sat, 8 Nov 2008 20:52:48 +0000 Subject: * Fixed a major memory leak in packet processing - PacketQueue.Close is never called, causing the PacketQueue for dead clients to be preserved (including it's contents). * This patch is highly experimental and may cause clients to not be able to connect, if this is the case, it will be rolled back in approximately 5 minutes. --- .../Region/ClientStack/LindenUDP/LLPacketQueue.cs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs index 9aa27ec..bb2d270 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs @@ -131,7 +131,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP userSettings.ClientThrottleMultipler); throttleTimer = new Timer((int) (throttletimems/throttleTimeDivisor)); - throttleTimer.Elapsed += new ElapsedEventHandler(ThrottleTimerElapsed); + throttleTimer.Elapsed += ThrottleTimerElapsed; throttleTimer.Start(); // TIMERS needed for this @@ -256,9 +256,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } + public void WipeClean() + { + m_log.Info("[PACKETQUEUE] Wiping Packet Queues Clean"); + lock(this) + { + ResendOutgoingPacketQueue.Clear(); + LandOutgoingPacketQueue.Clear(); + WindOutgoingPacketQueue.Clear(); + CloudOutgoingPacketQueue.Clear(); + TaskOutgoingPacketQueue.Clear(); + TaskLowpriorityPacketQueue.Clear(); + TextureOutgoingPacketQueue.Clear(); + AssetOutgoingPacketQueue.Clear(); + SendQueue.Clear(); + } + } + public void Close() { + m_log.Info("[PACKETQUEUE] Close called"); Flush(); + WipeClean(); // I'm sure there's a dirty joke in here somewhere. -AFrisby m_enabled = false; throttleTimer.Stop(); -- cgit v1.1