From 2f58d561371ed93202c276dfe0c359fcf6f70358 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Mon, 8 Nov 2010 02:37:28 +0000
Subject: Call the Cleanup when an agent logs out, when an agent leaves and
 just before an agent logs in directly. Intentionally not calling this from
 MakeRoot as that would mess up attachment transfer in teleport

---
 OpenSim/Region/Framework/Scenes/Scene.cs | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index be01d44..dd817ce 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3154,6 +3154,7 @@ namespace OpenSim.Region.Framework.Scenes
 
                     }
                     m_eventManager.TriggerClientClosed(agentID, this);
+                    CleanDroppedAttachments();
                 }
                 catch (NullReferenceException)
                 {
@@ -3408,6 +3409,8 @@ namespace OpenSim.Region.Framework.Scenes
 
             if (vialogin) 
             {
+                CleanDroppedAttachments();
+
                 if (TestBorderCross(agent.startpos, Cardinals.E))
                 {
                     Border crossedBorder = GetCrossedBorder(agent.startpos, Cardinals.E);
-- 
cgit v1.1