Is it necessary to call ReleaseStringUTFChars() if I have made a call to GetStringUTFChars() ?
say I have something like this:
FUNC(JNIEnv *env, jobject jObj, jstring jDeviceName)
{
const char* deviceName = env->GetStringUTFChars(jDeviceName, NULL);
}
If I don't call ReleaseStringUTFChars() will the memory obtained for deviceName not be freed even after we exit the native function?
deviveName is a local/auto pointer. So once the function is exited, the varible is pushed off the stack and the memory it pointed to is freed right?