NewByteArray / how to free it?
843829May 31 2005 — edited Jun 1 2005Hi,
Let's say I have a native method called package.foo().
package.foo() needs to call a java method and give it an array. It does not return the array.
void foo() {
jbytearray jdata = env->NewByteArray(ARRAY_SIZE);
// put data in array here
// now call native method
jenv->CallVoidMethod(blah,blah,jdata,0,ARRAY_SIZE);
}
Now, I can't really rewrite it to just return the array. So, what do i do with jdata when I'm done? do I call deleteLocal/GlobalRef() on it? leave it alone?
thanks,
--buddy