From 467d57a376e61aea43cebbd6c4b6980ea9b61598 Mon Sep 17 00:00:00 2001 From: LoveSy Date: Thu, 7 Dec 2023 10:50:20 +0800 Subject: [PATCH] Fix size --- lsplant/src/main/jni/include/utils/jni_helper.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lsplant/src/main/jni/include/utils/jni_helper.hpp b/lsplant/src/main/jni/include/utils/jni_helper.hpp index 9bc9b4f..21fdda0 100644 --- a/lsplant/src/main/jni/include/utils/jni_helper.hpp +++ b/lsplant/src/main/jni/include/utils/jni_helper.hpp @@ -1037,7 +1037,7 @@ class JObjectArrayElement { } explicit JObjectArrayElement(JNIEnv * env, jobjectArray array, int i, size_t size_) : - env_(env), array_(array), i_(i), + env_(env), array_(array), i_(i), size_(size) item_(obtain()) {} JObjectArrayElement &operator++() { @@ -1077,12 +1077,12 @@ public: } JObjectArrayElement& operator=(const JObjectArrayElement& s) { - item_ = s.item_.clone(); + reset(env_->NewLocalRef(s.item_.get())) return *this; } JObjectArrayElement& operator=(jobject s) { - item_.reset(env_->NewLocalRef(s)); + reset(env_->NewLocalRef(s)); return *this; }