diff --git a/src/Tgstation.Server.Host/Components/InstanceManager.cs b/src/Tgstation.Server.Host/Components/InstanceManager.cs index 00b4e42e3c..88a2286d47 100644 --- a/src/Tgstation.Server.Host/Components/InstanceManager.cs +++ b/src/Tgstation.Server.Host/Components/InstanceManager.cs @@ -49,6 +49,11 @@ namespace Tgstation.Server.Host.Components /// readonly Dictionary instances; + /// + /// If the has been d + /// + bool disposed; + /// /// Construct an /// @@ -73,6 +78,12 @@ namespace Tgstation.Server.Host.Components /// public void Dispose() { + lock (this) + { + if (disposed) + return; + disposed = true; + } foreach (var I in instances) I.Value.Dispose(); }