From 12295037642b5c13c46d1339766ada46e1ce3616 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Thu, 14 Feb 2008 11:10:43 +0000
Subject: Revert the index -> Add changes made in AvatarFactoryModule
 previously.  It appears that in conjunction with MW's locking changes, that
 two threads may race to create the avatar appearance in the
 TryGetAvatarAppearance() method.  Moving off Add will mean the second
 replaces the first instead of throwing the exception.  This may still not be
 a good permanent solution - more extensively locking or a code rearrangement
 could be better.  I'm going to leave this in MW's much more familiar hands
 now.

---
 OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'OpenSim/Region')

diff --git a/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs b/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs
index 6042a54..d7f23f8 100644
--- a/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs
+++ b/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs
@@ -72,7 +72,7 @@ namespace OpenSim.Region.Environment.Modules
                     appearance.TextureEntry = AvatarAppearance.GetDefaultTextureEntry();
                     lock (m_avatarsAppearance)
                     {
-                        m_avatarsAppearance.Add(avatarId, appearance);
+                        m_avatarsAppearance[avatarId] = appearance;
                     }
                     return true;
                 }
@@ -87,7 +87,7 @@ namespace OpenSim.Region.Environment.Modules
             //add appearance to dictionary cache
             lock (m_avatarsAppearance)
             {
-                m_avatarsAppearance.Add(avatarId, appearance);
+                m_avatarsAppearance[avatarId] = appearance;
             }
 
             //update database
-- 
cgit v1.1