mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-25 14:06:41 +01:00
Fixes being unable to repon a closed ControlPanel
This commit is contained in:
@@ -29,6 +29,7 @@ namespace TGControlPanel
|
||||
public ControlPanel(IInterface I)
|
||||
{
|
||||
InitializeComponent();
|
||||
FormClosed += ControlPanel_FormClosed;
|
||||
Interface = I;
|
||||
if (Interface.IsRemoteConnection)
|
||||
{
|
||||
@@ -46,13 +47,22 @@ namespace TGControlPanel
|
||||
UpdateSelectedPanel();
|
||||
InstancesInUse.Add(I.InstanceName, this);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Called when the <see cref="ControlPanel"/> is closed
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender of the event</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/></param>
|
||||
void ControlPanel_FormClosed(object sender, FormClosedEventArgs e)
|
||||
{
|
||||
InstancesInUse.Remove(Interface.InstanceName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called from <see cref="Dispose(bool)"/>
|
||||
/// </summary>
|
||||
void Cleanup()
|
||||
{
|
||||
InstancesInUse.Remove(Interface.InstanceName);
|
||||
Interface.Dispose();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user