HuaHuaY commented on code in PR #48851:
URL: https://github.com/apache/arrow/pull/48851#discussion_r2689272612


##########
cpp/src/arrow/util/compression_zstd.cc:
##########
@@ -178,6 +178,11 @@ class ZSTDCodec : public Codec {
                                ? kZSTDDefaultCompressionLevel
                                : compression_level) {}
 
+  ~ZSTDCodec() override {
+    ZSTD_freeCCtx(compression_context_);

Review Comment:
   Zstd documentation states that these two free functions can accept 
`nullptr`. But if someone thinks that null pointer judgment is needed here, I 
also support it. Or we can wrap it with `std::unique_ptr`.
   ```cpp
   size_t     ZSTD_freeCCtx(ZSTD_CCtx* cctx);  /* accept NULL pointer */
   size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);  /* accept NULL pointer */
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to