diff --git a/TGControlPanel/ControlPanel/ControlPanel.cs b/TGControlPanel/ControlPanel/ControlPanel.cs
index 58ec122120..f273c62a05 100644
--- a/TGControlPanel/ControlPanel/ControlPanel.cs
+++ b/TGControlPanel/ControlPanel/ControlPanel.cs
@@ -27,8 +27,9 @@ namespace TGControlPanel
/// The for the
public ControlPanel(Interface I)
{
- Interface = I;
InitializeComponent();
+ Interface = I;
+ Text += " Instance: " + I.InstanceName;
if (Interface.VersionMismatch(out string error) && MessageBox.Show(error, "Warning", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
{
Close();
diff --git a/TGControlPanel/InstanceSelector.cs b/TGControlPanel/InstanceSelector.cs
index 04fe99b902..fa6ae73761 100644
--- a/TGControlPanel/InstanceSelector.cs
+++ b/TGControlPanel/InstanceSelector.cs
@@ -95,8 +95,7 @@ namespace TGControlPanel
/// The name of the to connect to
async void TryConnectToInstance(string instanceName)
{
- var activeCP = ControlPanel.InstancesInUse[instanceName];
- if(activeCP != null)
+ if(ControlPanel.InstancesInUse.TryGetValue(instanceName, out ControlPanel activeCP))
{
activeCP.BringToFront();
return;
diff --git a/TGServerService/Service.cs b/TGServerService/Service.cs
index 06e85b7523..7792e7ab45 100644
--- a/TGServerService/Service.cs
+++ b/TGServerService/Service.cs
@@ -391,6 +391,7 @@ namespace TGServerService
var instance = (ServerInstance)host.SingletonInstance;
host.Close();
instance.Dispose();
+ UnlockLoggingID(instance.LoggingID);
}
}
catch (Exception e)
@@ -615,6 +616,7 @@ namespace TGServerService
path = inst.ServerDirectory();
inst.Offline();
inst.Dispose();
+ UnlockLoggingID(inst.LoggingID);
return null;
}
}