How should the result of NewObjectArray be handled if a failure occurs while partially filling up the new array?
That is, I want to abort the creation. Is it sufficient to delete the local reference to the array? Will this remove the children, as well?
Unless it’s assigned to a Java field or used as a JNI function return value, the reference will be garbage collected automagically once the native calls returns. It’s a local ref – those don’t live past the JNI call.