BADF00D / DisposableFixer

This is a Visual Studio Extension and NuGet package that should identify and fix problems as memleaks while using IDisposables.
Other
35 stars 7 forks source link

An IDisposable that is assigned to a field, is not marked as "Not Disposed" #7

Closed BADF00D closed 7 years ago

BADF00D commented 7 years ago

Actually this snipped worked correct,

using System.IO;
namespace DisFixerTest {
    class ClassWithUndisposedVariableInCtor {
        private MemoryStream _memStream;
        public void Method() {
            _memStream = new MemoryStream();
        }
    }
}

whereas this fails

using System.IO;
namespace DisFixerTest {
    class ClassWithUndisposedVariableInCtor {
        private IDisposable _memStream;
        public void Method() {
            _memStream = new MemoryStream();
        }
    }
}