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 standard Kernel32Util#closeHandle method that throws an exception if failed to close the handle #614

Merged
merged 1 commit into from
Mar 9, 2016

Conversation

lgoldstein
Copy link
Contributor

Provide bolierplate template for code that is supposed to close a handle and check the returned error code if failed to do so

@lgoldstein lgoldstein force-pushed the close-handle branch 2 times, most recently from eac4644 to 946a453 Compare March 8, 2016 18:43
@@ -42,6 +42,7 @@ Features
* [#612](https://github.com/java-native-access/jna/pull/612): Kernel32Util#freeLocal/GlobalMemory always throws Win32Exception if failed [@lgoldstein](https://github.com/lgoldstein).
* [#608](https://github.com/java-native-access/jna/pull/608): Mavenize the build process - change parent and native pom artifactId/name to differentiate in IDE and build tools. [@bhamail](https://github.com/bhamail)
* [#613](https://github.com/java-native-access/jna/pull/613): Make Win32Exception extend LastErrorException [@lgoldstein](https://github.com/lgoldstein).
* [#613](https://github.com/java-native-access/jna/pull/614): Added standard Kernel32Util#closeHandle method that throws a eption if failed to close the handle [@lgoldstein](https://github.com/lgoldstein).
Copy link
Member

Choose a reason for hiding this comment

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

throws a .... exception :) Also quote these function names in backticks probably (and above).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do.

@dblock
Copy link
Member

dblock commented Mar 9, 2016

Correct the typo in CHANGELOG, otherwise feel free to merge, code looks good.

@lgoldstein lgoldstein changed the title Added standard Kernel32Util#closeHandle method that throws a eption if failed to close the handle Added standard Kernel32Util#closeHandle method that throws an exception if failed to close the handle Mar 9, 2016
lgoldstein added a commit that referenced this pull request Mar 9, 2016
Added standard Kernel32Util#closeHandle method that throws an exception if failed to close the handle
@lgoldstein lgoldstein merged commit c23b590 into java-native-access:master Mar 9, 2016
@lgoldstein lgoldstein deleted the close-handle branch March 9, 2016 17:31
@@ -39,9 +39,10 @@ Features
* [#595](https://github.com/java-native-access/jna/pull/595): Allow calling COM methods/getters requiring hybrid calling (METHOD+PROPERTYGET) - [@matthiasblaesing](https://github.com/matthiasblaesing).
* [#582](https://github.com/java-native-access/jna/pull/582): Mavenize the build process - Phase 1: building the native code via Maven [@lgoldstein](https://github.com/lgoldstein).
* [#606](https://github.com/java-native-access/jna/pull/606): Added Kerne32Util method to facilitate checking that calls to LocalFree/GlobalFree are successful [@lgoldstein](https://github.com/lgoldstein).
* [#612](https://github.com/java-native-access/jna/pull/612): Kernel32Util#freeLocal/GlobalMemory always throws Win32Exception if failed [@lgoldstein](https://github.com/lgoldstein).
* [#612](https://github.com/java-native-access/jna/pull/612): 'Kernel32Util#freeLocal/GlobalMemory' always throws Win32Exception if failed [@lgoldstein](https://github.com/lgoldstein).
Copy link
Member

Choose a reason for hiding this comment

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

Those backticks are the wrong kind ;) Also above there's a typo, Kerne32Util is missing an L :)

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.

3 participants