Skip to content

Commit

Permalink
Fix array.setData() to retain before release (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardartoul authored and Richard Artoul committed Feb 14, 2020
1 parent 88cd05f commit 489ca25
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion go/arrow/array/array.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,13 @@ func (a *array) IsValid(i int) bool {
}

func (a *array) setData(data *Data) {
// Retain before releasing in case a.data is the same as data.
data.Retain()

if a.data != nil {
a.data.Release()
}

data.Retain()
if len(data.buffers) > 0 && data.buffers[0] != nil {
a.nullBitmapBytes = data.buffers[0].Bytes()
}
Expand Down

0 comments on commit 489ca25

Please sign in to comment.