Skip to content

Resource Leaks in processing/app/Util.java#1436

Open
SalmaneKhalili wants to merge 3 commits intoprocessing:mainfrom
SalmaneKhalili:main
Open

Resource Leaks in processing/app/Util.java#1436
SalmaneKhalili wants to merge 3 commits intoprocessing:mainfrom
SalmaneKhalili:main

Conversation

@SalmaneKhalili
Copy link

This PR add a simple implementation of what was suggested in #1432, at the moment it was only applied to unzip, i should be able to do the same for the rest of the methods mentioned in the issue, but id like to have feedback on the current way im going about it.

  • Added the test to gradle path
  • added the actual test.
  • added the solution

to put the test in the appropriate directory, id have to java files to
grade build configs, because it currently only checks for kotlin tests.
create a temp zip file > create a destination that is a file not a
directory (guaranteed exception) -> unzip throws ioexception because it
expects a directory not a file -> catch it -> check if the zip file is
still open -> if true == leak.
Copy link
Member

@tychedelia tychedelia left a comment

Choose a reason for hiding this comment

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

Looks good! We should just either gate or remove the test.

Copy link
Member

Choose a reason for hiding this comment

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

Probably better to not have a test than a platform specific test.

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