+ Prevent NetState nullification recursion if the NetState is being disposed.

* This issue is responsible for causing client crashes when logging out, one of the signs is the sound of your backpack closing multiple times.
* Fix prevents multiple calls to subsystems such as the trade window, which had the potential to dupe items when returning them to the trade partner.
* Credit goes to UO:Revealed (www.uorevealed.com) for reporting the circumstances which lead to the fix, which seems to have been an overlooked issue for a very long time.
This commit is contained in:
VitaNex 2016-06-11 21:32:20 +01:00
parent 4ffc2f33d1
commit e47753df2b
2 changed files with 9 additions and 2 deletions

View file

@ -8038,8 +8038,13 @@ namespace Server
{
get
{
if( m_NetState != null && m_NetState.Socket == null )
NetState = null;
if (m_NetState != null && m_NetState.Socket == null)
{
if (m_NetState.IsDisposing)
m_NetState = null;
else
NetState = null;
}
return m_NetState;
}

View file

@ -1114,6 +1114,8 @@ namespace Server.Network {
private bool m_Disposing;
public bool IsDisposing { get { return m_Disposing; } }
public void Dispose() {
Dispose( true );
}