From 56ebf308dc9a641dbe432b38d7df257ffec855d5 Mon Sep 17 00:00:00 2001 From: Trevor Norris Date: Wed, 22 Jan 2014 13:33:16 -0800 Subject: [PATCH] node: clear nextTickQueue when using domains When the domain specific code was reintroduced in 828f145 the conditional to check and clear the nextTickQueue if many items had run was not introduced. This allows for the application to run out of memory if domains are being used in an infinite recursive loop. --- src/node.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/node.js b/src/node.js index d39bef1822..36e712cf0f 100644 --- a/src/node.js +++ b/src/node.js @@ -698,6 +698,8 @@ } if (hasQueue) _unloadAsyncQueue(tock); + if (1e4 < tickInfo[kIndex]) + tickDone(); if (domain) domain.exit(); }