From 86af6ddc75a69b37d7a1905f3479af88af68944e Mon Sep 17 00:00:00 2001 From: Christiaan Baartse Date: Thu, 16 Jan 2014 14:58:50 +0100 Subject: [PATCH] Dont release Zalgo When calling pool.end(cb) cb is sometimes called synchronously and other times asynchronously. --- lib/Pool.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Pool.js b/lib/Pool.js index 7c5400d5f..391b90968 100644 --- a/lib/Pool.js +++ b/lib/Pool.js @@ -110,7 +110,7 @@ Pool.prototype.end = function (cb) { }.bind(this); if (this._allConnections.length === 0) { - return endCB(); + return process.nextTick(endCB); } for (var i = 0; i < this._allConnections.length; i++) {