S
Simon
Hi,
Sec. 4.4 of the JNI tutorial says that it is a good idea to cache field and
method IDs. I tried to also cache the jclass's which seemed to work in the
beginning but crashed the application later. I noticed that the jmethodID's are
the same every time I retrieve them but the jclass's are different (though I am
not sure how to compare them properly). If I use (*env)->FindClass(...)
everytime, everything works fine. Did anyone observe similar problems already?
I'm not providing my source code here because I don't think it helps much. I do
it almost exactly as described in Sect 4.4.2 "Caching in the Defining Class's
Initializer").
Cheers,
Simon
Sec. 4.4 of the JNI tutorial says that it is a good idea to cache field and
method IDs. I tried to also cache the jclass's which seemed to work in the
beginning but crashed the application later. I noticed that the jmethodID's are
the same every time I retrieve them but the jclass's are different (though I am
not sure how to compare them properly). If I use (*env)->FindClass(...)
everytime, everything works fine. Did anyone observe similar problems already?
I'm not providing my source code here because I don't think it helps much. I do
it almost exactly as described in Sect 4.4.2 "Caching in the Defining Class's
Initializer").
Cheers,
Simon