From 0632c4eaf48d7bd3ea21dd75612119eda3062223 Mon Sep 17 00:00:00 2001 From: Aaron Boyd Date: Tue, 9 Jul 2013 18:22:09 -0700 Subject: [PATCH] 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. --- lib/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/index.js b/lib/index.js index 5f1cea0..423c3ed 100644 --- a/lib/index.js +++ b/lib/index.js @@ -22,6 +22,7 @@ PG.prototype.end = function() { var self = this; Object.keys(self.pools.all).forEach(function(key) { var pool = self.pools.all[key]; + delete self.pools.all[key]; pool.drain(function() { pool.destroyAllNow(); });