diff --git a/mRemoteV1/Connection/Protocol/PuttyBase.cs b/mRemoteV1/Connection/Protocol/PuttyBase.cs
index 039e4ea7c..c40a0b069 100644
--- a/mRemoteV1/Connection/Protocol/PuttyBase.cs
+++ b/mRemoteV1/Connection/Protocol/PuttyBase.cs
@@ -236,11 +236,8 @@ namespace mRemoteNG.Connection.Protocol
try
{
- Console.WriteLine(@"Skipping Dispose for now!");
- PuttyProcess.Close();
- // TODO: Figure out why this hangs...
- //PuttyProcess.Dispose();
- Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strPuttyDisposeFailed + Environment.NewLine + @"SKIPPING DISPOSE - CAUSES HANG IN THIS BUILD!!!", true);
+ PuttyProcess.Close();
+ PuttyProcess.Dispose();
}
catch (Exception ex)
{
diff --git a/mRemoteV1/UI/Tabs/ConnectionTab.cs b/mRemoteV1/UI/Tabs/ConnectionTab.cs
index b47e913ad..0f1378593 100644
--- a/mRemoteV1/UI/Tabs/ConnectionTab.cs
+++ b/mRemoteV1/UI/Tabs/ConnectionTab.cs
@@ -13,11 +13,18 @@ namespace mRemoteNG.UI.Tabs
{
public partial class ConnectionTab : DockContent
{
+ ///
+ ///Silent close ignores the popup asking for confirmation
+ ///
public bool silentClose { get; set; }
+ ///
+ /// Protocol close ignores the interface controller cleanup and the user confirmation dialog
+ ///
+ public bool protocolClose { get; set; }
public ConnectionTab()
{
- InitializeComponent();
+ InitializeComponent();
GotFocus += ConnectionTab_GotFocus;
}
@@ -28,34 +35,37 @@ namespace mRemoteNG.UI.Tabs
protected override void OnFormClosing(FormClosingEventArgs e)
{
- if(!silentClose)
+ if(!protocolClose)
{
- if (Settings.Default.ConfirmCloseConnection == (int)ConfirmCloseEnum.All)
+ if (!silentClose)
{
- var result = CTaskDialog.MessageBox(this, GeneralAppInfo.ProductName, string.Format(Language.strConfirmCloseConnectionPanelMainInstruction, TabText), "", "", "", Language.strCheckboxDoNotShowThisMessageAgain, ETaskDialogButtons.YesNo, ESysIcons.Question, ESysIcons.Question);
- if (CTaskDialog.VerificationChecked)
+ if (Settings.Default.ConfirmCloseConnection == (int)ConfirmCloseEnum.All)
{
- Settings.Default.ConfirmCloseConnection--;
- }
- if (result == DialogResult.No)
- {
- e.Cancel = true;
+ var result = CTaskDialog.MessageBox(this, GeneralAppInfo.ProductName, string.Format(Language.strConfirmCloseConnectionPanelMainInstruction, TabText), "", "", "", Language.strCheckboxDoNotShowThisMessageAgain, ETaskDialogButtons.YesNo, ESysIcons.Question, ESysIcons.Question);
+ if (CTaskDialog.VerificationChecked)
+ {
+ Settings.Default.ConfirmCloseConnection--;
+ }
+ if (result == DialogResult.No)
+ {
+ e.Cancel = true;
+ }
+ else
+ {
+ ((InterfaceControl)Tag)?.Protocol.Close();
+ }
}
else
{
+ // close without the confirmation prompt...
((InterfaceControl)Tag)?.Protocol.Close();
}
}
else
{
- // close without the confirmation prompt...
((InterfaceControl)Tag)?.Protocol.Close();
}
}
- else
- {
- ((InterfaceControl)Tag)?.Protocol.Close();
- }
base.OnFormClosing(e);
}
diff --git a/mRemoteV1/UI/Window/ConnectionWindow.cs b/mRemoteV1/UI/Window/ConnectionWindow.cs
index e373e53e4..1a19f6aa4 100644
--- a/mRemoteV1/UI/Window/ConnectionWindow.cs
+++ b/mRemoteV1/UI/Window/ConnectionWindow.cs
@@ -741,7 +741,7 @@ namespace mRemoteNG.UI.Window
var protocolBase = sender as ProtocolBase;
if (!(protocolBase?.InterfaceControl.Parent is ConnectionTab tabPage)) return;
if (tabPage.Disposing) return;
- tabPage.silentClose = true;
+ tabPage.protocolClose = true;
Invoke(new Action(() => tabPage.Close()));
}