diff --git a/cpp/core/utils/qat/QatCodec.cc b/cpp/core/utils/qat/QatCodec.cc index 76c7c8b03b49..1a5fc8ea6db1 100644 --- a/cpp/core/utils/qat/QatCodec.cc +++ b/cpp/core/utils/qat/QatCodec.cc @@ -37,6 +37,11 @@ class QatZipCodec : public arrow::util::Codec { protected: explicit QatZipCodec(int compressionLevel) : compressionLevel_(compressionLevel) {} + ~QatZipCodec() { + (void)qzTeardownSession(&qzSession_); + (void)qzClose(&qzSession_); + } + arrow::Result Decompress(int64_t inputLen, const uint8_t* input, int64_t outputLen, uint8_t* output) override { uint32_t compressedSize = static_cast(inputLen);