Missed contract in MayBeClosedReferenceCounter.withRef
This commit is contained in:
parent
1a26d61cd2
commit
8bf13d0f69
@ -76,6 +76,9 @@ public sealed class MayBeClosedReferenceCounter {
|
|||||||
|
|
||||||
@JvmName("withRef\$kt")
|
@JvmName("withRef\$kt")
|
||||||
public inline fun <R> withRef(protected: () -> R): R {
|
public inline fun <R> withRef(protected: () -> R): R {
|
||||||
|
contract {
|
||||||
|
callsInPlace(protected, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
this.incref()
|
this.incref()
|
||||||
return safeAutoClose1(finally = this::decref, action = protected)
|
return safeAutoClose1(finally = this::decref, action = protected)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user