From ac0018cdfafa8b8b5de594ff9127c190d20f3f63 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Tue, 26 Mar 2013 21:19:09 +0100 Subject: [PATCH] Don't leak event listeners for process:uncaughtException --- src/node/hooks/express/errorhandling.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/node/hooks/express/errorhandling.js b/src/node/hooks/express/errorhandling.js index 3c595683..825c5f3b 100644 --- a/src/node/hooks/express/errorhandling.js +++ b/src/node/hooks/express/errorhandling.js @@ -28,6 +28,7 @@ exports.gracefulShutdown = function(err) { }, 3000); } +process.on('uncaughtException', exports.gracefulShutdown); exports.expressCreateServer = function (hook_name, args, cb) { exports.app = args.app; @@ -47,6 +48,4 @@ exports.expressCreateServer = function (hook_name, args, cb) { //https://github.com/joyent/node/issues/1553 process.on('SIGINT', exports.gracefulShutdown); } - - process.on('uncaughtException', exports.gracefulShutdown); -} +} \ No newline at end of file