use

inline fun <T : Managed, R> T.use(block: (T) -> R): R

Utility function to use managed object and them immediately release it.