Disconnect on form close too

same as 39205c975e
This commit is contained in:
Kurt
2020-05-09 10:35:14 -07:00
parent 60f3fa84a3
commit 6eff348fa5
2 changed files with 19 additions and 1 deletions

View File

@@ -28,6 +28,23 @@ private void B_Connect_Click(object sender, EventArgs e)
GB_Inject.Enabled = true;
}
private void SysBotRAMEdit_FormClosing(object sender, FormClosingEventArgs e)
{
if (!Bot.Bot.Connected)
return;
try
{
Bot.Bot.Disconnect();
}
#pragma warning disable CA1031 // Do not catch general exception types
catch (Exception ex)
#pragma warning restore CA1031 // Do not catch general exception types
{
Console.WriteLine(ex.Message);
}
}
private void B_Edit_Click(object sender, EventArgs e)
{
var offset = StringUtil.GetHexValue(RamOffset.Text);