aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-09-26 11:09:26 +0200
committerSven Gothel <[email protected]>2020-09-26 11:09:26 +0200
commit810fee658761a5555d98ea61819c627e3d5bfdd7 (patch)
treed3fcb2672525d9de75cd2c241e536a87875c9d85 /java
parent740bc1b3e905dacbb89980a46eb648818bf20762 (diff)
DBTAdapter.cxx [add|remove]StatusListener(): add-case needs setInstance before adding to receive the initial setting event; Use more readable getInstanceUnchecked() and clearInstance()
Diffstat (limited to 'java')
-rw-r--r--java/jni/helper_base.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/java/jni/helper_base.hpp b/java/jni/helper_base.hpp
index 164f679..99d0140 100644
--- a/java/jni/helper_base.hpp
+++ b/java/jni/helper_base.hpp
@@ -133,6 +133,10 @@ void setInstance(JNIEnv *env, jobject obj, T *t)
env->SetLongField(obj, getInstanceField(env, obj), instance);
}
+inline void clearInstance(JNIEnv *env, jobject obj) {
+ env->SetLongField(obj, getInstanceField(env, obj), 0);
+}
+
template <typename T>
jobject generic_clone(JNIEnv *env, jobject obj)
{