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

Null-check cleanable in Memory#close #1447

Merged
merged 1 commit into from Jun 29, 2022

Conversation

dbwiddis
Copy link
Contributor

@dbwiddis dbwiddis commented Jun 28, 2022

Fixes #1446

@dbwiddis dbwiddis changed the title Catch possible NPE in Memory#close if Cleaner runs first Null-check cleanable in Memory#close Jun 28, 2022
@dbwiddis dbwiddis marked this pull request as draft June 28, 2022 19:52
@dbwiddis dbwiddis marked this pull request as ready for review June 28, 2022 22:26
Copy link
Member

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

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

Looks sane to me - sorry, that I did not catch that.

It might be good to cut a point release after this - what do you think?

@dbwiddis
Copy link
Contributor Author

It might be good to cut a point release after this - what do you think?

Agreed. Should be faster without the need to rebuild the binaries, right?

@matthiasblaesing
Copy link
Member

It might be good to cut a point release after this - what do you think?

Agreed. Should be faster without the need to rebuild the binaries, right?

Yes, rebuilding binaries takes about a day, doing a release that only requires a java build is a matter of minutes (see https://github.com/java-native-access/jna/blob/master/www/ReleasingJNA.md)

@dbwiddis
Copy link
Contributor Author

a matter of minutes

I'd be happy to see a quick point release now. I need to do a point release on my own project soon so it'd be nice to update this as well.

sorry, that I did not catch that.

It was rather subtle! Thanks for helping identify the root cause.

@dbwiddis dbwiddis merged commit 2f919e5 into java-native-access:master Jun 29, 2022
@dbwiddis dbwiddis deleted the npe branch June 29, 2022 16:49
@matthiasblaesing
Copy link
Member

If you want here is a snapshot repository:

https://oss.sonatype.org/content/repositories/snapshots/

where 5.12.1-SNAPSHOT is present. If you can test with that it would be good, but if not, just say so, than I'll push the release tonight.

@dbwiddis
Copy link
Contributor Author

Tested with the snapshot, looks good.

@matthiasblaesing
Copy link
Member

Release is done - maven central sync should happen shortly. Thanks again for catching this so quickly.

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.

Using Memory#close can throw NPE if cleanable not initialized
2 participants