Added Kerne32Util method to facilitate checking that calls to LocalFree/GlobalFree are successful#606
Conversation
4e0f939 to
abdd1f9
Compare
| * [#589](https://github.com/java-native-access/jna/pull/589): Use MethodResultContext in direct mapping (as done in interface mapping) - [@marco2357](https://github.com/marco2357). | ||
| * [#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) |
There was a problem hiding this comment.
The syntax of these is - [@name](link)., mind fixing this one and the one above too please?
|
I think that in the |
|
Normally, I would agree with you - but as you can see from my code changes, most people don't bother to check the return value or the error. By using this piece of code ourselves we give a good example as to the kind of coding standards we recommend. Furthermore, by providing these helper methods we make acceptance and usage of said standards more likely. Also, specifically for the version with the return code - 2 reasons to keep it (IMO):
|
…ee/GlobalFree are successful
abdd1f9 to
8855dc9
Compare
Added Kerne32Util method to facilitate checking that calls to LocalFree/GlobalFree are successful
|
Personally I still don't love having both |
|
I agree on this one, if someone wants an error code they can call GetLastError on their own. Just make
|
The code does not turn one error into another - it simply gives the programmer the choice to examine the returned error code and decide on another kind of handling rather than throwing an exception.
If you feel this strongly about this I will do it (as a separate PR). |
|
@lgoldstein Yes, you're right, it gives the programmer the choice to examine the returned error code. I fairly strongly feel that the programmer should not have that choice in a |
|
Very well then, I will publish a PR that adheres to this convention soon (unless you'd rather I do it directly on the master branch) |
Motivation: we are a bit behind of the current quiche HEAD. Modifications: Update to latest HEAD Result: Use latest quiche code
The current code calls Local/GlobalFree without checking that they succeeded.