Skip to content

Commit

Permalink
fix: Fixed connection being recycled before disconnect event is consumed
Browse files Browse the repository at this point in the history
  • Loading branch information
TwoTenPvP committed Dec 17, 2019
1 parent 82c3b2a commit defbae6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Ruffles/Core/NetworkEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void Recycle()
}
}

if (Connection != null && Connection.Dead && !Connection.Recycled)
if (Connection != null && Connection.Dead && !Connection.Recycled && (Type == NetworkEventType.Disconnect || Type == NetworkEventType.Timeout))
{
Connection.Recycled = true;
}
Expand Down

0 comments on commit defbae6

Please sign in to comment.