remove reference to pool when destroying

Leaving a reference to the pool means the
destroyed pool will get returned if you
later try to reconnect with the same
connection string.
This commit is contained in:
Aaron Boyd 2013-07-09 18:22:09 -07:00
parent 3f4a44e973
commit 0632c4eaf4

View File

@ -22,6 +22,7 @@ PG.prototype.end = function() {
var self = this; var self = this;
Object.keys(self.pools.all).forEach(function(key) { Object.keys(self.pools.all).forEach(function(key) {
var pool = self.pools.all[key]; var pool = self.pools.all[key];
delete self.pools.all[key];
pool.drain(function() { pool.drain(function() {
pool.destroyAllNow(); pool.destroyAllNow();
}); });