I want to cache method IDs across calls. For this I get method IDs:
// Put static to clarify it's saved across calls.
static jmethodID method = env->GetMethodID(class_HelloWorld, name, signature);
My question is: do I need to make class_HelloWorld
a global ref with NewGlobalRef
or method IDs can be obtained from local ref and saved (I get class_HelloWorld
using FindClass
) without need for global ref-ing the class metadata?