Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions java/driver/jni/src/main/cpp/jni_wrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ struct JniStringView {
}

env->ReleaseStringUTFChars(jni_string, value);
env->DeleteLocalRef(jni_string);
jni_string = nullptr;
}
};
Expand Down Expand Up @@ -544,11 +545,15 @@ Java_org_apache_arrow_adbc_driver_jni_impl_NativeAdbc_statementExecutePartitions
for (size_t i = 0; i < partitions.num_partitions; i++) {
size_t length = partitions.partition_lengths[i];
jbyteArray partition = env->NewByteArray(static_cast<jsize>(length));
if (partition == nullptr || env->ExceptionCheck()) goto cleanupall;
env->SetByteArrayRegion(partition, 0, static_cast<jsize>(length),
reinterpret_cast<const jbyte*>(partitions.partitions[i]));
if (env->ExceptionCheck()) goto cleanupall;
env->CallObjectMethod(result, native_result_add_partition, partition);
if (env->ExceptionCheck()) goto cleanupall;
// The Java side has a reference now, so free the per-iteration local
// reference to avoid overflowing the local reference table
env->DeleteLocalRef(partition);
}
} catch (const AdbcException& e) {
e.ThrowJavaException(env);
Expand Down
Loading