paulirwin opened a new pull request, #1074: URL: https://github.com/apache/lucenenet/pull/1074
- [X] You've read the [Contributor Guide](https://github.com/apache/lucenenet/blob/main/CONTRIBUTING.md) and [Code of Conduct](https://www.apache.org/foundation/policies/conduct.html). - [ ] You've included unit or integration tests for your change, where applicable. - [X] You've included inline docs for your change, where applicable. - [X] There's an open issue for the PR that you are making. If you'd like to propose a change, please [open an issue](https://github.com/apache/lucenenet/issues/new/choose) to discuss the change or find an existing issue. Disposes of some IDisposable objects that are not properly cleaned up. Fixes #615 Partial #265 ## Description This adds `using` statements to clean up some disposable objects where it's possible to do so, after a review of our codebase with CA2000 code analysis warnings on, where the objects were determined to not "leak" via fields, return values, or the like. This also fixes two FileStream leaks in demo code, #615. Note that CA2000 is _way_ too noisy to leave on, as there are literally hundreds of "violations" that would make our code a mess with `#pragma` suppressions. The Java upstream code is perhaps a little loose with keeping track of ICloseable lifetimes, but we have to match that in most cases. The cases fixed here were just ones where the object lifetime did not escape the method and it was safe to do so. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@lucenenet.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org