IEnumerable<T>
doesn't implement IDisposable
and most - if not all - standard implementations of IEnumerable<T>
don't implement IDisposable
either. So the TPL doesn't dispose it for you if you actually return an instance of a collection that needs disposing.
But this really should never be the case if you want to return an empty enumerable, because in that case you could just return Enumerable.Empty<T>()
or new T[0]
.
Actually, I think you are confusing "disposing" and "garbage collection".
The empty enumerable will be available for garbage collection as soon as there are no more references pointing to it.
So, to sum it up: You don't have to worry about that, except when you want to return a very exotic enumerable implementation.