zeroshade commented on a change in pull request #11712:
URL: https://github.com/apache/arrow/pull/11712#discussion_r751409009
##########
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:
```go
for i, field := range schema.Fields() {
cols[i] = ctx.loadArray(field.Type)
defer cols[i].Release()
}
```
No need for the separate defer func and loop
--
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]