use<R> method
R
use<R>(
- R callback(
- T
Applies callback on this object and then delete the underlying JNI
reference, returning the result of callback.
Implementation
R use<R>(R Function(T) callback) {
try {
final result = callback(this);
return result;
} finally {
this?.release();
}
}