diff options
author | Sven Gothel <[email protected]> | 2020-10-18 06:53:32 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-10-18 06:53:32 +0200 |
commit | 76bd754835370d8523a4e0ae39ee6b4a80ba3516 (patch) | |
tree | d472ae6786248824d000555036595377a5a8d0c5 | |
parent | f1f5d420e3e76f4d34337b59ea04fb6f6cae5681 (diff) |
direct_bt/JNI: Adopt to JavaUplink changes
-rw-r--r-- | java/jni/direct_bt/DBTManager.cxx | 2 | ||||
-rw-r--r-- | java/jni/direct_bt/DBTNativeDownlink.cxx | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/java/jni/direct_bt/DBTManager.cxx b/java/jni/direct_bt/DBTManager.cxx index 2cd71e64..f113848c 100644 --- a/java/jni/direct_bt/DBTManager.cxx +++ b/java/jni/direct_bt/DBTManager.cxx @@ -60,7 +60,7 @@ void Java_direct_1bt_tinyb_DBTManager_deleteImpl(JNIEnv *env, jobject obj, jlong try { DBTManager *manager = castInstance<DBTManager>(nativeInstance); // special: static singleton manager->close(); - manager->setJavaObject(nullptr); + manager->setJavaObject(); (void) manager; } catch(...) { rethrow_and_raise_java_exception(env); diff --git a/java/jni/direct_bt/DBTNativeDownlink.cxx b/java/jni/direct_bt/DBTNativeDownlink.cxx index 0202d78c..d328c085 100644 --- a/java/jni/direct_bt/DBTNativeDownlink.cxx +++ b/java/jni/direct_bt/DBTNativeDownlink.cxx @@ -49,8 +49,7 @@ void Java_direct_1bt_tinyb_DBTNativeDownlink_initNativeJavaObject(JNIEnv *env, j if( nullptr == mNotifyDeleted ) { throw InternalError("DBTNativeDownlink class has no notifyDeleted() method, for "+javaUplink->toString(), E_FILE_LINE); } - std::shared_ptr<JavaGlobalObj> jobjRef( new JavaGlobalObj(obj, mNotifyDeleted) ); - javaUplink->setJavaObject( jobjRef ); + javaUplink->setJavaObject( std::shared_ptr<JavaAnon>( new JavaGlobalObj(obj, mNotifyDeleted) ) ); JavaGlobalObj::check(javaUplink->getJavaObject(), E_FILE_LINE); DBG_JNI_PRINT("Java_direct_1bt_tinyb_DBTNativeDownlink_initNativeJavaObject %p -> %s", javaUplink, javaUplink->toString().c_str()); } catch(...) { @@ -64,7 +63,7 @@ void Java_direct_1bt_tinyb_DBTNativeDownlink_deleteNativeJavaObject(JNIEnv *env, try { JavaUplink *javaUplink = castInstance<JavaUplink>(nativeInstance); DBG_JNI_PRINT("Java_direct_1bt_tinyb_DBTNativeDownlink_deleteNativeJavaObject %p -> %s", javaUplink, javaUplink->toString().c_str()); - javaUplink->setJavaObject(nullptr); + javaUplink->setJavaObject(); } catch(...) { rethrow_and_raise_java_exception(env); } |