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

Disposables within an array should be treated differently #35

Open dscopra opened 7 years ago

dscopra commented 7 years ago
var memstreams= new []{
   new MemoryStream(), 
   new MemoryStream(),
}

foreach(var memsteam in memstreams){
   mestream.Dispose();
}

Each memstream is individually marked as not disposed, But they are tracked by the array memstreams and are disposed later.

BADF00D commented 6 years ago

Notification can be suppressed if declaration is part of an array that is part of an invocation to a tracking type/method/ctor.