diff --git a/lib/operations/mongo_client_ops.js b/lib/operations/mongo_client_ops.js index 1a2e559f9d..ac879481f4 100644 --- a/lib/operations/mongo_client_ops.js +++ b/lib/operations/mongo_client_ops.js @@ -665,9 +665,9 @@ function generateCredentials(client, username, password, options) { function closeOperation(client, force, callback) { const completeClose = err => { - client.emit('close', this); + client.emit('close', client); for (const name in client.s.dbCache) { - client.s.dbCache[name].emit('close'); + client.s.dbCache[name].emit('close', client); } client.removeAllListeners('close');