mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
Fix regression where multiple close agents could be sent to the wrong neighbour region on root agent close.
This was introduced in git master d214e2d0 (Thu May 16 17:12:02 2013)
Caught out by the fact that value types used in iterators act like references and this was dispatched asynchronously.
Should address http://opensimulator.org/mantis/view.php?id=6658
This commit is contained in:
@@ -222,7 +222,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public void SendCloseChildAgentConnections(UUID agentID, List<ulong> regionslst)
|
||||
{
|
||||
foreach (ulong handle in regionslst)
|
||||
Util.FireAndForget(delegate { SendCloseChildAgent(agentID, handle); });
|
||||
{
|
||||
// We must take a copy here since handle is acts like a reference when used in an iterator.
|
||||
// This leads to race conditions if directly passed to SendCloseChildAgent with more than one neighbour region.
|
||||
ulong handleCopy = handle;
|
||||
Util.FireAndForget((o) => { SendCloseChildAgent(agentID, handleCopy); });
|
||||
}
|
||||
}
|
||||
|
||||
public List<GridRegion> RequestNamedRegions(string name, int maxNumber)
|
||||
|
||||
Reference in New Issue
Block a user