Do I need to call ReleaseIntArrayElements on an array created with NewIntArray?
You don't need to do anything with it. It is a local reference and it will be cleaned up when your JNI method exits. As Edward Thompson hints above, ReleaseIntArrayElements()
is the converse of GetIntArrayElements().
It has no other function.
You have to release only reference:
jintArray pixels = env->NewIntArray(width * height);
...
env->DeleteLocalRef(pixels)