Added a check to GridServerBase.RegisterInterface<T>(T iface), so that it can't try to add duplicate interfaces and cause a exception.

GenericGridServerConcept
MW 2009-02-21 14:24:25 +00:00
parent 65d413e5ee
commit 869c64f955
1 changed files with 4 additions and 1 deletions

View File

@ -218,10 +218,13 @@ namespace OpenSim.Grid.GridServer
public void RegisterInterface<T>(T iface) public void RegisterInterface<T>(T iface)
{ {
lock (m_gridInterfaces) lock (m_gridInterfaces)
{
if (!m_gridInterfaces.ContainsKey(typeof(T)))
{ {
m_gridInterfaces.Add(typeof(T), iface); m_gridInterfaces.Add(typeof(T), iface);
} }
} }
}
public bool TryGet<T>(out T iface) public bool TryGet<T>(out T iface)
{ {