From e6cf9dce1cb5218fc8f584aa861086588e60e0b0 Mon Sep 17 00:00:00 2001 From: Faryan Rezagholi Date: Fri, 19 Jun 2020 23:00:02 +0200 Subject: [PATCH] return from closed event when form is already disposed. possible fix for #1794 --- mRemoteNG/UI/Window/ConnectionWindow.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mRemoteNG/UI/Window/ConnectionWindow.cs b/mRemoteNG/UI/Window/ConnectionWindow.cs index 5ddd07e0..9cdb9965 100644 --- a/mRemoteNG/UI/Window/ConnectionWindow.cs +++ b/mRemoteNG/UI/Window/ConnectionWindow.cs @@ -798,7 +798,7 @@ namespace mRemoteNG.UI.Window { var protocolBase = sender as ProtocolBase; if (!(protocolBase?.InterfaceControl.Parent is ConnectionTab tabPage)) return; - if (tabPage.Disposing) return; + if (tabPage.Disposing || tabPage.IsDisposed) return; tabPage.protocolClose = true; Invoke(new Action(() => tabPage.Close())); }