Commit 9bde191a authored by Lukáš Marek's avatar Lukáš Marek

Local reference release fix

parent f71f4b4e
......@@ -1723,10 +1723,14 @@ static void * jb_worker_loop(void * obj) {
// dispatch sending buffer
buffs_send(pb);
// ** tmp buff + local ref release **
// ** buff return **
// return processed buffer - the reset (to empty) is done in java
(*jni_env)->CallStaticVoidMethod(jni_env, cl_buffer_pool, mtd_put_empty, obj_buff);
//TODO ! check args + checking of return value
// ** tmp buff + local ref release **
// JNI_ABORT releases the memory without copying the data back to java array
(*jni_env)->ReleaseByteArrayElements(jni_env, data_jarray, data, JNI_ABORT);
(*jni_env)->ReleaseIntArrayElements(jni_env, tag_pos_jarray, tag_pos, JNI_ABORT);
......@@ -1735,11 +1739,6 @@ static void * jb_worker_loop(void * obj) {
(*jni_env)->DeleteLocalRef(jni_env, obj_tag_buffer);
(*jni_env)->DeleteLocalRef(jni_env, tag_objects_jarray);
(*jni_env)->DeleteLocalRef(jni_env, tag_pos_jarray);
// ** buff return **
// return processed buffer - the reset (to empty) is done in java
(*jni_env)->CallStaticVoidMethod(jni_env, cl_buffer_pool, mtd_put_empty, obj_buff);
}
// TODO ! free thread local memory and release thread local global jobject references
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment