Skip to content

Commit 8faf8a0

Browse files
authored
fix(pg-cursor): EventEmitter memory leak (brianc#2501)
1 parent d99b574 commit 8faf8a0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/pg-cursor/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ util.inherits(Cursor, EventEmitter)
2828
Cursor.prototype._ifNoData = function () {
2929
this.state = 'idle'
3030
this._shiftQueue()
31+
if (this.connection) {
32+
this.connection.removeListener('rowDescription', this._rowDescription)
33+
}
3134
}
3235

3336
Cursor.prototype._rowDescription = function () {

0 commit comments

Comments
 (0)