I have some Java/JNI code that must be compiled in two different environments:

* a standard environment using OpenJDK / GCC;
* an embedded environment using JamaicaVM (old version) / Sparc-GCC.

In the version I am stuck with of the JamaicaVM, the implementation of JNI is not fully conforming, and in particular, functions returning `jmethodID`/`jFieldID`s return local references.

I can free the IDs using `DeleteLocalRef`, but I was wondering if this may raise issues in conforming JNI environment? Is the following safe?

```
jmethodID myMethod = env->GetMethodID(...);
// Do stuff with myMethod
env->DeleteLocalRef(myMethod);

```