Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added 2 more try-with resources block to avoid leaking handles #9

Closed
wants to merge 1 commit into from

Conversation

krosenvold
Copy link

After submitting my previous pull request, I looked at other uses of the sendContent method that accepts a filechannel and to my understanding most of them leak.

try (ReadableByteChannel in=((Resource)content).getReadableByteChannel())
{
if (in!=null)
sendContent(in,callback);
Copy link
Contributor

Choose a reason for hiding this comment

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

this is async call, so you can't close resource in try

@krosenvold krosenvold closed this Aug 9, 2013
lorban added a commit that referenced this pull request Nov 8, 2022
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
lorban added a commit that referenced this pull request Nov 21, 2022
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
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.

None yet

2 participants