Skip to content

Null-check cleanable in Memory#close#1447

Merged
dbwiddis merged 1 commit into
java-native-access:masterfrom
dbwiddis:npe
Jun 29, 2022
Merged

Null-check cleanable in Memory#close#1447
dbwiddis merged 1 commit into
java-native-access:masterfrom
dbwiddis:npe

Conversation

@dbwiddis

@dbwiddis dbwiddis commented Jun 28, 2022

Copy link
Copy Markdown
Contributor

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

@matthiasblaesing matthiasblaesing left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

Tested with the snapshot, looks good.

@matthiasblaesing

Copy link
Copy Markdown
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