Merge pull request #2862 from mRemoteNG/copilot/fix-unhandled-exception-panel-closure

Fix unhandled exception when closing panel with active connections
This commit is contained in:
Dimitrij
2025-10-07 20:40:35 +01:00
committed by GitHub

View File

@@ -776,6 +776,7 @@ namespace mRemoteNG.UI.Window
ProtocolBase protocolBase = sender as ProtocolBase;
if (!(protocolBase?.InterfaceControl.Parent is ConnectionTab tabPage)) return;
if (tabPage.Disposing || tabPage.IsDisposed) return;
if (IsDisposed || Disposing) return;
tabPage.protocolClose = true;
Invoke(new Action(() => tabPage.Close()));
}