From f456a7e868218a2461183f52a92fc281e9d0ca6c Mon Sep 17 00:00:00 2001 From: Rong Ma Date: Fri, 24 Nov 2023 21:07:43 +0800 Subject: [PATCH] [VL] Fix: close QAT codec correctly (#3840) Some of the inner structures of qzSession_ are not released without calling qzTeardownSession. --- cpp/core/utils/qat/QatCodec.cc | 5 +++++ 1 file changed, 5 insertions(+) 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);