fix: Tidy up socket dispose. (#1334)
This commit is contained in:
parent
14ef1ab7e5
commit
44c69620a6
3 changed files with 46 additions and 48 deletions
|
|
@ -1091,6 +1091,12 @@ public partial class NetState : IComparable<NetState>
|
|||
}
|
||||
#endif
|
||||
|
||||
var m = Mobile;
|
||||
if (m?.NetState == this)
|
||||
{
|
||||
m.NetState = null;
|
||||
}
|
||||
|
||||
TcpServer.Instances.Remove(this);
|
||||
try
|
||||
{
|
||||
|
|
@ -1104,14 +1110,8 @@ public partial class NetState : IComparable<NetState>
|
|||
Connection.Close();
|
||||
_handle.Free();
|
||||
|
||||
var m = Mobile;
|
||||
Mobile = null;
|
||||
|
||||
if (m?.NetState == this)
|
||||
{
|
||||
m.NetState = null;
|
||||
}
|
||||
|
||||
var a = Account;
|
||||
|
||||
Gumps.Clear();
|
||||
|
|
@ -1120,6 +1120,7 @@ public partial class NetState : IComparable<NetState>
|
|||
Account = null;
|
||||
ServerInfo = null;
|
||||
CityInfo = null;
|
||||
Connection = null;
|
||||
|
||||
var count = TcpServer.Instances.Count;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue