aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/AgentCircuitManager.cs20
1 files changed, 16 insertions, 4 deletions
diff --git a/OpenSim/Framework/AgentCircuitManager.cs b/OpenSim/Framework/AgentCircuitManager.cs
index 09333bd..56b40bd 100644
--- a/OpenSim/Framework/AgentCircuitManager.cs
+++ b/OpenSim/Framework/AgentCircuitManager.cs
@@ -81,13 +81,25 @@ namespace OpenSim.Framework
81 /// <param name="agentData"></param> 81 /// <param name="agentData"></param>
82 public virtual void AddNewCircuit(uint circuitCode, AgentCircuitData agentData) 82 public virtual void AddNewCircuit(uint circuitCode, AgentCircuitData agentData)
83 { 83 {
84 if (AgentCircuits.ContainsKey(circuitCode)) 84 lock (AgentCircuits)
85 { 85 {
86 AgentCircuits[circuitCode] = agentData; 86 if (AgentCircuits.ContainsKey(circuitCode))
87 {
88 AgentCircuits[circuitCode] = agentData;
89 }
90 else
91 {
92 AgentCircuits.Add(circuitCode, agentData);
93 }
87 } 94 }
88 else 95 }
96
97 public virtual void RemoveCircuit(uint circuitCode)
98 {
99 lock (AgentCircuits)
89 { 100 {
90 AgentCircuits.Add(circuitCode, agentData); 101 if (AgentCircuits.ContainsKey(circuitCode))
102 AgentCircuits.Remove(circuitCode);
91 } 103 }
92 } 104 }
93 105