Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
jni: Fix onTokenLock() invocation from native code
Fix the type signature to reflect 0 arguments, and make sure the int
return value propagates back to the library.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
  • Loading branch information
cernekee committed Aug 17, 2014
1 parent 3c0966f commit a6eaca7
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions jni.c
Expand Up @@ -534,13 +534,10 @@ static int lock_token_cb(void *privdata)
if ((*ctx->jenv)->PushLocalFrame(ctx->jenv, 256) < 0)
return -1;

mid = get_obj_mid(ctx, ctx->jobj, "onTokenLock", "(V)I");
if (!mid)
goto out;

(*ctx->jenv)->CallIntMethod(ctx->jenv, ctx->jobj, mid);
mid = get_obj_mid(ctx, ctx->jobj, "onTokenLock", "()I");
if (mid)
ret = (*ctx->jenv)->CallIntMethod(ctx->jenv, ctx->jobj, mid);

out:
(*ctx->jenv)->PopLocalFrame(ctx->jenv, NULL);
return ret;
}
Expand Down

0 comments on commit a6eaca7

Please sign in to comment.