Dispose open handle on the package#20136
Dispose open handle on the package#20136Anipik merged 1 commit intodotnet:mainfrom Anipik:closeHandle
Conversation
|
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
| Package package = CreatePackage(packageReader, runtimeGraph); | ||
| package.PackagePath = packagePath; | ||
| return package; | ||
| using (PackageArchiveReader packageReader = new PackageArchiveReader(packagePath)) |
There was a problem hiding this comment.
NIT: you could also just use the inline using since the scope is the variable scope anyway. Also, inside method CreatePackage we seem to be using a NuspecReader, is that disposable too? If so, does it get disposed by PackageArchiveReader.Dispose? If not we should add a using there as well.
There was a problem hiding this comment.
Also, inside method CreatePackage we seem to be using a NuspecReader, is that disposable too?
NuspecReader is not disposable. I will leave "using" as it for now (donot want to rekick the builds).
joperezr
left a comment
There was a problem hiding this comment.
Small comment left but this looks good otherwise. Good catch.
|
/backport to release/6.0.1xx-rc1 |
This is dangling reference and we are hitting file contetnion issues because of this while trying to use this package in aspnet core repo
Tested locally and it no longer repros