summaryrefslogtreecommitdiff
path: root/vendor/github.com/jackc/pgx/v5/rows.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/jackc/pgx/v5/rows.go')
-rw-r--r--vendor/github.com/jackc/pgx/v5/rows.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/vendor/github.com/jackc/pgx/v5/rows.go b/vendor/github.com/jackc/pgx/v5/rows.go
index f6f26f479..3e64a3adb 100644
--- a/vendor/github.com/jackc/pgx/v5/rows.go
+++ b/vendor/github.com/jackc/pgx/v5/rows.go
@@ -188,6 +188,17 @@ func (rows *baseRows) Close() {
} else if rows.queryTracer != nil {
rows.queryTracer.TraceQueryEnd(rows.ctx, rows.conn, TraceQueryEndData{rows.commandTag, rows.err})
}
+
+ // Zero references to other memory allocations. This allows them to be GC'd even when the Rows still referenced. In
+ // particular, when using pgxpool GC could be delayed as pgxpool.poolRows are allocated in large slices.
+ //
+ // https://github.com/jackc/pgx/pull/2269
+ rows.values = nil
+ rows.scanPlans = nil
+ rows.scanTypes = nil
+ rows.ctx = nil
+ rows.sql = ""
+ rows.args = nil
}
func (rows *baseRows) CommandTag() pgconn.CommandTag {