diff options
Diffstat (limited to 'java/jni/helper_base.hpp')
-rw-r--r-- | java/jni/helper_base.hpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/java/jni/helper_base.hpp b/java/jni/helper_base.hpp index a1f8bbdc..18ae8679 100644 --- a/java/jni/helper_base.hpp +++ b/java/jni/helper_base.hpp @@ -116,6 +116,13 @@ T *getInstance(JNIEnv *env, jobject obj) } template <typename T> +T *getInstanceUnchecked(JNIEnv *env, jobject obj) +{ + jlong instance = env->GetLongField(obj, getInstanceField(env, obj)); + return reinterpret_cast<T *>(instance); +} + +template <typename T> void setInstance(JNIEnv *env, jobject obj, T *t) { if (t == nullptr) { |