Skip to content

Commit c708c6d

Browse files
author
Noam Preil
committed
fixup
1 parent fe72cf4 commit c708c6d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arrow/ipc/message.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"io"
2323
"sync/atomic"
2424

25+
"github.com/apache/arrow-go/v18/arrow/internal/debug"
2526
"github.com/apache/arrow-go/v18/arrow/internal/flatbuf"
2627
"github.com/apache/arrow-go/v18/arrow/memory"
2728
)
@@ -157,7 +158,7 @@ func (r *messageReader) Retain() {
157158
// When the reference count goes to zero, the memory is freed.
158159
// Release may be called simultaneously from multiple goroutines.
159160
func (r *messageReader) Release() {
160-
r.refCount.Load()
161+
debug.Assert(r.refCount.Load() > 0, "too many releases")
161162

162163
if r.refCount.Add(-1) == 0 {
163164
if r.msg != nil {

0 commit comments

Comments
 (0)