After a Dequeue from ConcurrentQueue<T> (in System.threading for 3.5SP1 as well as macorlib in .NEt 4.0) the array entry is not set to default(T). This causes the referenced item to remain rooted, causing a potentially serious memory leak.The problem appears to be in the System.Collections.Concurrent.ConcurrentQueue<T>+Segment.TryRemove(out T, ref ConcurrentQueue<T>.Segment) method. This retreves the element from the array with result = this.m_array[low]; but does not execute this.m_array[low] = default(T); . The dequeued item is still in the array.See http://stackoverflow.com/questions/2678165/net-framework-possible-memory-leaky-classes/2679315#2679315
Product Language
Visual Studio Version
Operating System
Operating System Language
Steps to Reproduce
Actual Results
Expected Results