deleteLocalRef

context(env: JniEnv)
fun JObject.deleteLocalRef()(source)

Deletes the local reference pointed to by the receiver.

Note: JDK/JRE 1.1 provides the DeleteLocalRef function above so that programmers can manually delete local references. For example, if native code iterates through a potentially large array of objects and uses one element in each iteration, it is a good practice to delete the local reference to the no-longer-used array element before a new local reference is created in the next iteration.

As of JDK/JRE 1.2 an additional set of functions are provided: ensureLocalCapacity, pushLocalFrame, popLocalFrame and newLocalRef.