Lock m_UserCache whilst iterating over it in UserManagementModule.GetUserData() to avoid concurrency exceptions
parent
e65d1e459e
commit
6ae426c96b
|
@ -246,10 +246,15 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
|
||||||
}
|
}
|
||||||
|
|
||||||
// search the local cache
|
// search the local cache
|
||||||
foreach (UserData data in m_UserCache.Values)
|
lock (m_UserCache)
|
||||||
if (users.Find(delegate(UserData d) { return d.Id == data.Id; }) == null &&
|
{
|
||||||
(data.FirstName.ToLower().StartsWith(query.ToLower()) || data.LastName.ToLower().StartsWith(query.ToLower())))
|
foreach (UserData data in m_UserCache.Values)
|
||||||
users.Add(data);
|
{
|
||||||
|
if (users.Find(delegate(UserData d) { return d.Id == data.Id; }) == null &&
|
||||||
|
(data.FirstName.ToLower().StartsWith(query.ToLower()) || data.LastName.ToLower().StartsWith(query.ToLower())))
|
||||||
|
users.Add(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
AddAdditionalUsers(query, users);
|
AddAdditionalUsers(query, users);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue