Skip to content

fix(code): close Reader in code#853

Open
tejasae-afk wants to merge 1 commit into
btraceio:developfrom
tejasae-afk:fix/close-reader-in-code
Open

fix(code): close Reader in code#853
tejasae-afk wants to merge 1 commit into
btraceio:developfrom
tejasae-afk:fix/close-reader-in-code

Conversation

@tejasae-afk

@tejasae-afk tejasae-afk commented Jun 6, 2026

Copy link
Copy Markdown

Came across this in btrace-compiler/src/main/java/io/btrace/compiler/PCPP.java while following the call chain — The resource opened there can leak if code exits on an error path. this patch moves the allocation into try-with-resources so cleanup happens on every exit path. Feel free to close if not relevant.

Happy to revise the approach or close this if it doesn’t fit — you know the codebase far better than I do.


This change is Reviewable

@jbachorik jbachorik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks legit. Thanks for the contribution!

@jbachorik jbachorik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Actually the code structure is broken. Please fix before merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants