CurtHagenlocher commented on code in PR #308:
URL: https://github.com/apache/arrow-dotnet/pull/308#discussion_r3048363746


##########
src/Apache.Arrow/Ipc/ArrowStreamWriter.cs:
##########
@@ -797,6 +840,7 @@ private protected void WriteRecordBatchInternal(RecordBatch 
recordBatch)
                 recordBatchOffset, recordBatchBuilder.TotalLength);
 
             long bufferLength = WriteBufferData(recordBatchBuilder.Buffers);
+            recordBatchBuilder.DisposeDeferredArrays();
 

Review Comment:
   I'm going to address this partially. An exception inside the factory method 
will still end up "leaking" the buffer (it will live until its finalizer runs) 
but one that happens during writing will get properly disposed. To do any 
better requires restructuring of the code is as better achieved in a separate 
refactoring PR.



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