Calling the above method produces the following warning, we didn't catch it earlier because this was disabled in the analyzer
Severity Code Description Project File Line Suppression State Detail Description
Warning CA2000 Call System.IDisposable.Dispose on object created by 'reader.ReadSequence(' before all references to it are out of scope IceRpc D:\IceRPC\icerpc-csharp\src\IceRpc\Internal\TelemetryDispatcher.cs 90 Active If a disposable object is not explicitly disposed before all references to it are out of scope, the object will be disposed at some indeterminate time when the garbage collector runs the finalizer of the object. Because an exceptional event might occur that will prevent the finalizer of the object from running, the object should be explicitly disposed instead.
As pointed by @bernardnormier the problem seems to be CollectionBase<T> implements IEnumerator<T>, which is IDisposable
https://github.com/zeroc-ice/icerpc-csharp/blob/d6e781f84a3a95bbf45ff248844e3562b8667b36/src/IceRpc/Internal/TelemetryDispatcher.cs#L89
Calling the above method produces the following warning, we didn't catch it earlier because this was disabled in the analyzer
As pointed by @bernardnormier the problem seems to be
CollectionBase<T>
implementsIEnumerator<T>
, which isIDisposable