fix: Reverts timer change in Detach (#1892)

This commit is contained in:
Kamron Batman 2024-07-28 15:55:05 -07:00 committed by GitHub
parent 07d6e6b491
commit 2eac11f535
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -153,6 +153,18 @@ public partial class Timer
Running = false;
// We are the head on the timer ring
if (_rings[_ring][_slot] == this)
{
_rings[_ring][_slot] = _nextTimer;
}
// We are the head on the executing ring
if (_executingRings[_ring] == this)
{
_executingRings[_ring] = _nextTimer;
}
Detach();
OnDetach();
@ -200,18 +212,6 @@ public partial class Timer
private void Detach()
{
// We are the head on the timer ring
if (_rings[_ring][_slot] == this)
{
_rings[_ring][_slot] = _nextTimer;
}
// We are the head on the executing ring
if (_executingRings[_ring] == this)
{
_executingRings[_ring] = _nextTimer;
}
if (_prevTimer != null)
{
_prevTimer._nextTimer = _nextTimer;