Open marco2357 opened 10 years ago
good catch.
On Apr 4, 2014, at 10:58 AM, marco2357 notifications@github.com wrote:
If a callback is implemented through a CallbackProxy, it is probably a bad idea to allow it being called directly (bypassing the proxy).
diff --git a/src/com/sun/jna/CallbackReference.java b/src/com/sun/jna/CallbackReference.java index bcf5568..5b15301 100644 --- a/src/com/sun/jna/CallbackReference.java +++ b/src/com/sun/jna/CallbackReference.java @@ -150,6 +150,7 @@ // Check whether direct mapping may be used, or whether // we need to fall back to conventional mapping boolean ppc = Platform.isPPC();
- if (callback instanceof CallbackProxy) direct = false; if (direct) { Method m = getCallbackMethod(callback); Class[] ptypes = m.getParameterTypes();
Also "boolean ppc = ...;" can be put into the "if (direct) {" block
— Reply to this email directly or view it on GitHub.
This should be a PR, please.
If a callback is implemented through a CallbackProxy, it is probably a bad idea to allow it being called directly (bypassing the proxy).
Also "boolean ppc = ...;" can be put into the "if (direct) {" block