Skip to content

Commit 8347e8c

Browse files
committed
Do not return the node if the synchronizer is disposed
1 parent a9a4d93 commit 8347e8c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/DotNext.Threading/Threading/QueuedSynchronizer.Queue.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ private void ReturnNode(WaitNode node)
4949
}
5050

5151
// the node is removed for sure, it can be returned back to the pool
52-
if (node.TryReset(out _))
52+
if (node.TryReset(out _) && !IsDisposingOrDisposed)
5353
{
5454
pool.Return(node);
5555
}

0 commit comments

Comments
 (0)