what is global about the clsStr variable which is “clsStr = (*env)->NewGlobalRef(env,cls)”?
问题 Global Reference in JNI is said to be a reference that has to be manually freed by the programmer. It has nothing to do with the c context. so a code like : { jclass clsStr = (*env)->NewGlobalRef(env,cls); } return clsStr; will give an error saying that clsStr is undefined / undeclared . I understand this. But what i don't understand is the use of these type of references. What is global about clsStr in the above code ? How this variable can be useful in future or after the call returns ? I