diff options
Diffstat (limited to 'java/jni/direct_bt/helper_dbt.hpp')
-rw-r--r-- | java/jni/direct_bt/helper_dbt.hpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/java/jni/direct_bt/helper_dbt.hpp b/java/jni/direct_bt/helper_dbt.hpp index 40e2c609..d71104e7 100644 --- a/java/jni/direct_bt/helper_dbt.hpp +++ b/java/jni/direct_bt/helper_dbt.hpp @@ -59,6 +59,7 @@ namespace direct_bt { class JavaGlobalObj : public JavaAnonObj { private: JNIGlobalRef javaObjectRef; + jmethodID mNotifyDeleted; public: static inline void check(const std::shared_ptr<JavaAnonObj> & shref, const char* file, int line) { @@ -80,13 +81,16 @@ namespace direct_bt { } return true; } - JavaGlobalObj(jobject obj) : javaObjectRef(obj) { } + JavaGlobalObj(jobject obj, jmethodID mNotifyDeleted) + : javaObjectRef(obj), mNotifyDeleted(mNotifyDeleted) { } JavaGlobalObj(const JavaGlobalObj &o) noexcept = default; JavaGlobalObj(JavaGlobalObj &&o) noexcept = default; JavaGlobalObj& operator=(const JavaGlobalObj &o) noexcept = default; JavaGlobalObj& operator=(JavaGlobalObj &&o) noexcept = default; + virtual ~JavaGlobalObj(); + std::string toString() const override { const uint64_t ref = (uint64_t)(void*)javaObjectRef.getObject(); return "JavaGlobalObj["+uint64HexString(ref, true)+"]"; @@ -113,7 +117,6 @@ namespace direct_bt { } }; - jclass search_class(JNIEnv *env, JavaUplink &object); template <typename T> |