node: clear nextTickQueue when using domains
authorTrevor Norris <trev.norris@gmail.com>
Wed, 22 Jan 2014 21:33:16 +0000 (13:33 -0800)
committerTrevor Norris <trev.norris@gmail.com>
Wed, 22 Jan 2014 21:33:16 +0000 (13:33 -0800)
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

index d39bef1..36e712c 100644 (file)
         }
         if (hasQueue)
           _unloadAsyncQueue(tock);
+        if (1e4 < tickInfo[kIndex])
+          tickDone();
         if (domain)
           domain.exit();
       }