DisposableFixer icon indicating copy to clipboard operation
DisposableFixer copied to clipboard

Disposables within an array should be treated differently

Open dscopra opened this issue 8 years ago • 1 comments

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.

dscopra avatar May 16 '17 15:05 dscopra

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

BADF00D avatar Feb 27 '18 13:02 BADF00D