Skip to content

Commit

Permalink
fix(test): check refcount > 0 in Base64Buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
silenium-dev committed Aug 10, 2024
1 parent 706a2ab commit de0e439
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class Base64Buffer : Reference<Base64Buffer> {

override fun close() {
println("Decrementing buffer ref count")
check(refCount_.get() > 0L) { "Ref count is already 0" }
if (refCount_.decrementAndGet() == 0L) {
println("Closing buffer")
buffer.clear()
Expand Down

0 comments on commit de0e439

Please sign in to comment.