fromRefFrame
inline fun <T : JRef<O>, O : _jobject> fromRefFrame(capacity: Int, block: () -> T?): T?(source)
Executes the block in a new local reference frame, in which at least a given number of local references can be created. Then pops the frame, freeing all the local references except the result of the block and return it.
Note that local references already created in previous local frames are still valid in the current local frame.
If you need to use one of the local references created in the block outside of the block, you must return this refence from the lambda. It will be accessible as a result of fromRefFrame.
Some Java Virtual Machine implementations may choose to limit the maximum capacity, which may cause the function to throw an exception.
Since
JDK/JRE 1.2
Parameters
the minimum number of required local references. Must be > 0.
the block to execute in the local reference frame.