return from closed event when form is already disposed. possible fix for #1794

This commit is contained in:
Faryan Rezagholi
2020-06-19 23:00:02 +02:00
parent 9232535763
commit e6cf9dce1c

View File

@@ -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()));
}