mirror of
https://github.com/kiwix/java-libkiwix.git
synced 2025-08-04 03:26:08 -04:00
parent
4a8e966e5d
commit
3f58dc2ecf
@ -95,6 +95,7 @@ METHOD0(jobjectArray, getIllustrations) {
|
||||
for (auto illu: illustrations) {
|
||||
auto wrapper = BUILD_WRAPPER("org/kiwix/libkiwix/Illustration", illu);
|
||||
env->SetObjectArrayElement(retArray, index++, wrapper);
|
||||
env->DeleteLocalRef(wrapper);
|
||||
}
|
||||
return retArray;
|
||||
} CATCH_EXCEPTION(nullptr)
|
||||
|
@ -104,6 +104,7 @@ METHOD(jobjectArray, getBookmarks, jboolean onlyValidBookmarks) {
|
||||
shared_ptr<kiwix::Bookmark>* handle = new shared_ptr<kiwix::Bookmark>(new kiwix::Bookmark(std::move(bookmark)));
|
||||
jobject wrapper = env->NewObject(wrapperClass, initMethod, reinterpret_cast<jlong>(handle));
|
||||
env->SetObjectArrayElement(retArray, index++, wrapper);
|
||||
env->DeleteLocalRef(wrapper);
|
||||
}
|
||||
return retArray;
|
||||
} CATCH_EXCEPTION(nullptr)
|
||||
|
@ -263,6 +263,7 @@ template<> struct JTypeArray<std::string>{
|
||||
for(size_t index=0; index<length; index++) {
|
||||
auto jElem = c2jni(data[index], env);
|
||||
env->SetObjectArrayElement(array, index, jElem);
|
||||
env->DeleteLocalRef(jElem);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user