mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-31 09:02:41 +01:00
Closes the serviceHost in OnStop
This commit is contained in:
+14
-10
@@ -324,19 +324,23 @@ namespace TGServerService
|
||||
/// </summary>
|
||||
protected override void OnStop()
|
||||
{
|
||||
try
|
||||
lock (this)
|
||||
{
|
||||
foreach (var I in hosts)
|
||||
try
|
||||
{
|
||||
var host = I.Value;
|
||||
var instance = (ServerInstance)host.SingletonInstance;
|
||||
host.Close();
|
||||
instance.Dispose();
|
||||
foreach (var I in hosts)
|
||||
{
|
||||
var host = I.Value;
|
||||
var instance = (ServerInstance)host.SingletonInstance;
|
||||
host.Close();
|
||||
instance.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
WriteEntry(e.ToString(), EventID.ServiceShutdownFail, EventLogEntryType.Error, LoggingID);
|
||||
catch (Exception e)
|
||||
{
|
||||
WriteEntry(e.ToString(), EventID.ServiceShutdownFail, EventLogEntryType.Error, LoggingID);
|
||||
}
|
||||
serviceHost.Close();
|
||||
}
|
||||
Properties.Settings.Default.Save();
|
||||
ActiveService = null;
|
||||
|
||||
Reference in New Issue
Block a user