Skip to content
Merged
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
9 changes: 6 additions & 3 deletions cpp/core/jni/JniCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,12 @@ class JavaRssClient : public RssClient {
return;
}
env->DeleteGlobalRef(javaRssShuffleWriter_);
jbyte* byteArray = env->GetByteArrayElements(array_, NULL);
env->ReleaseByteArrayElements(array_, byteArray, JNI_ABORT);
env->DeleteGlobalRef(array_);
// array_ may be nullptr when failed to allocate new byte array in pushPartitionData
if (array_ != nullptr) {
jbyte* byteArray = env->GetByteArrayElements(array_, NULL);
env->ReleaseByteArrayElements(array_, byteArray, JNI_ABORT);
env->DeleteGlobalRef(array_);
}
}

int32_t pushPartitionData(int32_t partitionId, const char* bytes, int64_t size) override {
Expand Down