diff options
author | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2017-03-05 14:10:55 +0300 |
---|---|---|
committer | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2017-03-05 14:10:55 +0300 |
commit | 15c040a4305ed566a7e49ffd67ccaaa8b10a6330 (patch) | |
tree | fc91f2244072955682f670abf4f39492c6f74429 | |
parent | c316f016ca6a0ad77c2751922ec0ba4aa2d52364 (diff) |
Drop shell connections on disconnect
-rw-r--r-- | ClovershellConnection.cs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ClovershellConnection.cs b/ClovershellConnection.cs index 4066f98..9d54305 100644 --- a/ClovershellConnection.cs +++ b/ClovershellConnection.cs @@ -139,6 +139,9 @@ namespace com.clusterrr.cloverhack foreach (var pending in pendingShellConnections)
pending.socket.Close();
pendingShellConnections.Clear();
+ foreach (var connection in shellConnecionThreads)
+ connection.Abort();
+ shellConnecionThreads.Clear();
shellEnabled = value;
}
}
@@ -286,6 +289,9 @@ namespace com.clusterrr.cloverhack }
if (online) Debug.WriteLine("clovershell disconnected");
online = false;
+ foreach (var connection in shellConnecionThreads)
+ connection.Abort();
+ shellConnecionThreads.Clear();
if (device != null)
device.Close();
device = null;
|