Skip to content

Commit

Permalink
Print error of inflateEnd
Browse files Browse the repository at this point in the history
  • Loading branch information
schlaubi authored and schlaubi committed Jan 25, 2024
1 parent 27eefb3 commit 2dfc534
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions gateway/src/nativeMain/kotlin/Inflater.kt
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,14 @@ private class NativeInflater : Inflater {
}

override fun close() {
inflateEnd(zStream.ptr)
nativeHeap.free(zStream)
try {
val response = inflateEnd(zStream.ptr)
if(response != Z_OK) {
throw ZLibException("Could not end zstream: ${zErrorMessage(response)}")
}
} finally {
nativeHeap.free(zStream)
}
}
}

Expand Down

0 comments on commit 2dfc534

Please sign in to comment.