fix(pg-cursor): EventEmitter memory leak (#2501)

This commit is contained in:
Erona 2021-04-13 23:57:37 +08:00 committed by GitHub
parent d99b5741f8
commit 8faf8a0937
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,6 +28,9 @@ util.inherits(Cursor, EventEmitter)
Cursor.prototype._ifNoData = function () {
this.state = 'idle'
this._shiftQueue()
if (this.connection) {
this.connection.removeListener('rowDescription', this._rowDescription)
}
}
Cursor.prototype._rowDescription = function () {