optimized form closing event

This commit is contained in:
Faryan Rezagholi
2021-08-10 00:56:14 +02:00
parent 3dd8db5728
commit 29f7dd93f3

View File

@@ -407,6 +407,18 @@ namespace mRemoteNG.UI.Forms
private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
{
if (Runtime.WindowList != null)
{
foreach (BaseWindow window in Runtime.WindowList)
{
window.Close();
}
}
Hide();
IsClosing = true;
if (Settings.Default.CloseToTray)
{
if (Runtime.NotificationAreaIcon == null)
@@ -461,18 +473,8 @@ namespace mRemoteNG.UI.Forms
Shutdown.Cleanup(_quickConnectToolStrip, _externalToolsToolStrip, _multiSshToolStrip, this);
IsClosing = true;
Cef.Shutdown();
if (Runtime.WindowList != null)
{
foreach (BaseWindow window in Runtime.WindowList)
{
window.Close();
}
}
Shutdown.StartUpdate();
Debug.Print("[END] - " + Convert.ToString(DateTime.Now, CultureInfo.InvariantCulture));