zeroshade commented on a change in pull request #11712:
URL: https://github.com/apache/arrow/pull/11712#discussion_r751679489



##########
File path: go/arrow/ipc/file_reader.go
##########
@@ -337,6 +341,11 @@ func newRecord(schema *arrow.Schema, meta *memory.Buffer, 
body ReadAtSeeker) arr
        for i, field := range schema.Fields() {
                cols[i] = ctx.loadArray(field.Type)
        }
+       defer func() {
+               for _, c := range cols {
+                       c.Release()
+               }
+       }()

Review comment:
       yup, it's perfectly okay. Remember that defer's only run at the end of 
the enclosing *function* not scope.




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