Skip to content

Commit

Permalink
EventLoopScheduler: set _nextItem to null on Tick (#421)
Browse files Browse the repository at this point in the history
If _queue is empty after the item is removed from it, then _nextItem is never overriden and therefore keeps a reference to item.
Until another action is scheduled with a future due time, the item and all its associated state is kept in memory.
(cherry picked from commit 2679e8e)
  • Loading branch information
TobBrandt-Work authored and Oren Novotny committed May 26, 2018
1 parent 56272f0 commit aea0a5b
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,10 @@ private void Tick(object state)
if (!_disposed)
{
var item = (ScheduledItem<TimeSpan>)state;
if (item == _nextItem)
{
_nextItem = null;
}
if (_queue.Remove(item))
{
_readyList.Enqueue(item);
Expand Down

0 comments on commit aea0a5b

Please sign in to comment.