Signed-off-by: Graham <gpe@openrs2.org>
@ -2,10 +2,10 @@ package org.openrs2.buffer
import io.netty.util.ReferenceCounted
public inline fun <T : ReferenceCounted, R> T.use(block: (T) -> R): R {
public inline fun <T : ReferenceCounted?, R> T.use(block: (T) -> R): R {
try {
return block(this)
} finally {
release()
this?.release()
}