diff options
author | Justin Clark-Casey (justincc) | 2013-05-21 17:25:06 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-05-21 17:25:06 +0100 |
commit | 6ae426c96ba0bfdad9e884364f5b6be5b4cd61a9 (patch) | |
tree | 9934d8a263fefa98ba40250057206072d650d741 | |
parent | fix error in hull point indexing (diff) | |
download | opensim-SC-6ae426c96ba0bfdad9e884364f5b6be5b4cd61a9.zip opensim-SC-6ae426c96ba0bfdad9e884364f5b6be5b4cd61a9.tar.gz opensim-SC-6ae426c96ba0bfdad9e884364f5b6be5b4cd61a9.tar.bz2 opensim-SC-6ae426c96ba0bfdad9e884364f5b6be5b4cd61a9.tar.xz |
Lock m_UserCache whilst iterating over it in UserManagementModule.GetUserData() to avoid concurrency exceptions
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index 6847e57..d99c8eb 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | |||
@@ -246,10 +246,15 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
246 | } | 246 | } |
247 | 247 | ||
248 | // search the local cache | 248 | // search the local cache |
249 | foreach (UserData data in m_UserCache.Values) | 249 | lock (m_UserCache) |
250 | if (users.Find(delegate(UserData d) { return d.Id == data.Id; }) == null && | 250 | { |
251 | (data.FirstName.ToLower().StartsWith(query.ToLower()) || data.LastName.ToLower().StartsWith(query.ToLower()))) | 251 | foreach (UserData data in m_UserCache.Values) |
252 | users.Add(data); | 252 | { |
253 | if (users.Find(delegate(UserData d) { return d.Id == data.Id; }) == null && | ||
254 | (data.FirstName.ToLower().StartsWith(query.ToLower()) || data.LastName.ToLower().StartsWith(query.ToLower()))) | ||
255 | users.Add(data); | ||
256 | } | ||
257 | } | ||
253 | 258 | ||
254 | AddAdditionalUsers(query, users); | 259 | AddAdditionalUsers(query, users); |
255 | 260 | ||