From 290dd36bb0b916db62f5af217e837d171b6273e2 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 13 Jan 2014 11:52:24 +0800 Subject: [PATCH] Activate uv loop when calling childProcess.fork. Fixes #156. --- renderer/lib/init.coffee | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/renderer/lib/init.coffee b/renderer/lib/init.coffee index 824dbd2c9e..84fb257c19 100644 --- a/renderer/lib/init.coffee +++ b/renderer/lib/init.coffee @@ -37,6 +37,13 @@ process.nextTick = wrapWithActivateUvLoop process.nextTick global.setImmediate = wrapWithActivateUvLoop timers.setImmediate global.clearImmediate = timers.clearImmediate +# The child_process module also needs to activate the uv loop to make the ipc +# channel setup. +# TODO(zcbenz): Find out why this is needed. +childProcess = require 'child_process' +childProcess.spawn = wrapWithActivateUvLoop childProcess.spawn +childProcess.fork = wrapWithActivateUvLoop childProcess.fork + # Set the __filename to the path of html file if it's file:// protocol. if window.location.protocol is 'file:' global.__filename =