I'm returning a jstring from a JNI method. I delete the local reference to it before returning the value.

JNIEXPORT jstring JNICALL TestJNIMethod( JNIEnv* env, jclass )
{
    jstring  test_string = env->NewStringUTF( "test_string_value" );
    env->DeleteLocalRef( test_string );
    return test_string;
}

Would the calling JAVA method be still able to access the returned jstring or would the Garbage collector cleanup the memory?

Edit
Report