bkietz commented on code in PR #570:
URL: https://github.com/apache/arrow-nanoarrow/pull/570#discussion_r1698654761


##########
src/nanoarrow/ipc/encoder.c:
##########
@@ -52,11 +52,13 @@ void ArrowIpcEncoderReset(struct ArrowIpcEncoder* encoder) {
   NANOARROW_DCHECK(encoder != NULL && encoder->private_data != NULL);
   struct ArrowIpcEncoderPrivate* private =
       (struct ArrowIpcEncoderPrivate*)encoder->private_data;
-  flatcc_builder_clear(&private->builder);
-  ArrowBufferReset(&private->nodes);
-  ArrowBufferReset(&private->buffers);
-  ArrowFree(private);
-  memset(encoder, 0, sizeof(struct ArrowIpcEncoder));
+  if (private != NULL) {

Review Comment:
   I'll remove the debug check. IIUC we should always be allowed to call Reset 
(this is how decoder's Reset functions)



-- 
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