Skip to content

Conversation

ian-wd
Copy link

@ian-wd ian-wd commented Apr 16, 2025

Context:

  • calling these methods produces LeakedClosableViolation on android StrictMode
  • fix ensures any opened input stream are properly handled and closed

@iBotPeaches iBotPeaches requested a review from Copilot April 16, 2025 12:09
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses a potential resource leak by refactoring the input stream handling to use the try-with-resources statement.

  • Replaces manual resource management with try-with-resources in readFile and read methods
  • Ensures that opened InputStreams are automatically closed to avoid LeakedClosableViolation on Android

@iBotPeaches iBotPeaches requested a review from jyann April 16, 2025 12:09
@iBotPeaches iBotPeaches merged commit 0c10b75 into master Apr 16, 2025
1 check passed
@iBotPeaches iBotPeaches deleted the close-input-stream branch April 16, 2025 13:54
@iBotPeaches iBotPeaches mentioned this pull request Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants