1 | initial version |
Solved.
The problem is i was in a different matrix, that i've passed from c++ code. When returning a matrix address from jni, i had to use:
Mat ret = getSomeMatrix();
return (jlong) new Mat(ret);
because the java constructor Mat(long addr) doesn't add a reference to the counter of the matrix, but the finalizer does remove one reference.
2 | No.2 Revision |
Solved.
The problem is i was in a different matrix, that i've passed from c++ code.
When returning a matrix address from jni, i had to use:
Mat ret = getSomeMatrix();
return (jlong) new Mat(ret);
because the java constructor Mat(long addr) doesn't add a reference to the counter of the matrix, but the finalizer does remove one reference.