From 55e0a49dffb3f66002e08f261a15baaa641b53f8 Mon Sep 17 00:00:00 2001 From: NYAN CAT Date: Sat, 1 Jun 2019 12:12:49 +0300 Subject: [PATCH] Update Clients.cs --- AsyncRAT-C#/AsyncRAT-Sharp/Socket/Clients.cs | 24 +++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/AsyncRAT-C#/AsyncRAT-Sharp/Socket/Clients.cs b/AsyncRAT-C#/AsyncRAT-Sharp/Socket/Clients.cs index bcad215..ea359db 100644 --- a/AsyncRAT-C#/AsyncRAT-Sharp/Socket/Clients.cs +++ b/AsyncRAT-C#/AsyncRAT-Sharp/Socket/Clients.cs @@ -11,6 +11,7 @@ using AsyncRAT_Sharp.MessagePack; using System.Text; using System.Net.Security; using System.Security.Authentication; +using System.Threading.Tasks; namespace AsyncRAT_Sharp.Sockets { @@ -115,20 +116,21 @@ namespace AsyncRAT_Sharp.Sockets public void Disconnected() { - try + if (LV != null) { - if (LV != null) - { - if (Program.form1.listView1.InvokeRequired) - Program.form1.listView1.BeginInvoke((MethodInvoker)(() => + if (Program.form1.listView1.InvokeRequired) + Program.form1.listView1.BeginInvoke((MethodInvoker)(() => + { + try { - LV.Remove(); - })); - lock (Settings.Online) - Settings.Online.Remove(this); - } + lock (Settings.Listview1Lock) + LV.Remove(); + } + catch { } + })); + lock (Settings.Online) + Settings.Online.Remove(this); } - catch { } try {