diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 86d0112..aecb362 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -411,38 +411,34 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
411 | "[CLIENT]: Close has been called for {0} attached to scene {1}", | 411 | "[CLIENT]: Close has been called for {0} attached to scene {1}", |
412 | Name, m_scene.RegionInfo.RegionName); | 412 | Name, m_scene.RegionInfo.RegionName); |
413 | 413 | ||
414 | // Remove ourselves from the scene | 414 | // Send the STOP packet |
415 | m_scene.ClientManager.Remove(m_agentId, m_udpClient.RemoteEndPoint); | 415 | DisableSimulatorPacket disable = (DisableSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.DisableSimulator); |
416 | OutPacket(disable, ThrottleOutPacketType.Unknown); | ||
417 | |||
418 | IsActive = false; | ||
416 | 419 | ||
420 | // Shutdown the image manager | ||
417 | if (m_imageManager != null) | 421 | if (m_imageManager != null) |
418 | { | ||
419 | m_imageManager.Close(); | 422 | m_imageManager.Close(); |
420 | m_imageManager = null; | ||
421 | } | ||
422 | |||
423 | if (m_udpServer != null) | ||
424 | { | ||
425 | m_udpServer.Flush(); | ||
426 | } | ||
427 | 423 | ||
424 | // Fire the callback for this connection closing | ||
428 | if (OnConnectionClosed != null) | 425 | if (OnConnectionClosed != null) |
429 | OnConnectionClosed(this); | 426 | OnConnectionClosed(this); |
430 | 427 | ||
431 | CloseCleanup(); | 428 | // Flush all of the packets out of the UDP server for this client |
432 | } | 429 | if (m_udpServer != null) |
430 | m_udpServer.Flush(m_udpClient); | ||
433 | 431 | ||
434 | private void CloseCleanup() | 432 | // Remove ourselves from the scene |
435 | { | ||
436 | m_scene.RemoveClient(AgentId); | 433 | m_scene.RemoveClient(AgentId); |
434 | m_scene.ClientManager.Remove(this); | ||
437 | 435 | ||
438 | //m_log.InfoFormat("[CLIENTVIEW] Memory pre GC {0}", System.GC.GetTotalMemory(false)); | 436 | //m_log.InfoFormat("[CLIENTVIEW] Memory pre GC {0}", System.GC.GetTotalMemory(false)); |
437 | //GC.Collect(); | ||
439 | //m_log.InfoFormat("[CLIENTVIEW] Memory post GC {0}", System.GC.GetTotalMemory(true)); | 438 | //m_log.InfoFormat("[CLIENTVIEW] Memory post GC {0}", System.GC.GetTotalMemory(true)); |
440 | 439 | ||
441 | // Send the STOP packet | 440 | // FIXME: Is this still necessary? |
442 | DisableSimulatorPacket disable = (DisableSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.DisableSimulator); | 441 | //Thread.Sleep(2000); |
443 | OutPacket(disable, ThrottleOutPacketType.Unknown); | ||
444 | |||
445 | Thread.Sleep(2000); | ||
446 | 442 | ||
447 | // Shut down timers. Thread Context of this method is murky. Lock all timers | 443 | // Shut down timers. Thread Context of this method is murky. Lock all timers |
448 | if (m_avatarTerseUpdateTimer.Enabled) | 444 | if (m_avatarTerseUpdateTimer.Enabled) |
@@ -459,8 +455,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
459 | // We need to do this over grid communications | 455 | // We need to do this over grid communications |
460 | //m_scene.CloseAllAgents(CircuitCode); | 456 | //m_scene.CloseAllAgents(CircuitCode); |
461 | 457 | ||
462 | IsActive = false; | ||
463 | |||
464 | m_avatarTerseUpdateTimer.Dispose(); | 458 | m_avatarTerseUpdateTimer.Dispose(); |
465 | m_primTerseUpdateTimer.Dispose(); | 459 | m_primTerseUpdateTimer.Dispose(); |
466 | m_primFullUpdateTimer.Dispose(); | 460 | m_primFullUpdateTimer.Dispose(); |