If an ObjectCreation of MethodInvokation returns an IDisposable that is assigned to a field variables that is not IDisposable, there is hint that this is an undisposed IDisposable.
public interface IDoNothing{}
public class Implementation : IDoNothing, IDisposable{
public void Dispose(){}
}
public class Usage{
private readonly IDoNothing _object;
public Usage(){
_object = new Implementation(); //this is an undisposed IDisposable that is not recognized
}
}
If an ObjectCreation of MethodInvokation returns an IDisposable that is assigned to a field variables that is not IDisposable, there is hint that this is an undisposed IDisposable.