close the protocol properly, just not the DockContent...

This commit is contained in:
Sean Kaim
2019-01-08 12:16:50 -05:00
parent 8a94000d98
commit a107d0586f
2 changed files with 18 additions and 3 deletions

View File

@@ -41,6 +41,11 @@ namespace mRemoteNG.UI.Tabs
((InterfaceControl)Tag).Protocol.Close();
}
}
else
{
// close without the confirmation prompt...
((InterfaceControl)Tag).Protocol.Close();
}
}
else
{

View File

@@ -4,6 +4,7 @@ using System.Drawing;
using System.Drawing.Drawing2D;
using System.Security.Permissions;
using System.Windows.Forms;
using mRemoteNG.Connection;
using WeifenLuo.WinFormsUI.Docking;
namespace mRemoteNG.UI.Tabs
@@ -1250,7 +1251,8 @@ namespace mRemoteNG.UI.Tabs
private void Close_Click(object sender, EventArgs e)
{
DockPane.CloseActiveContent();
CloseProtocol();
if (PatchController.EnableMemoryLeakFix == true)
{
ContentClosed();
@@ -1332,8 +1334,14 @@ namespace mRemoteNG.UI.Tabs
base.OnRightToLeftChanged(e);
PerformLayout();
}
#region Native Methods
private void CloseProtocol()
{
var ic = InterfaceControl.FindInterfaceControl(DockPane.DockPanel);
ic?.Protocol.Close();
}
#region Native Methods
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
protected override void WndProc(ref Message m)
{
@@ -1343,7 +1351,9 @@ namespace mRemoteNG.UI.Tabs
if (!Settings.Default.DoubleClickOnTabClosesIt) return;
// Option is set, close the tab, then send to base.
DockPane.CloseActiveContent();
//DockPane.CloseActiveContent();
CloseProtocol();
if (PatchController.EnableMemoryLeakFix == true)
{
ContentClosed();