From: Cheng Zhao Date: Mon, 13 Jan 2014 03:52:24 +0000 (+0800) Subject: Activate uv loop when calling childProcess.fork. X-Git-Tag: v0.8.4~5 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=290dd36bb0b916db62f5af217e837d171b6273e2;p=electron.git Activate uv loop when calling childProcess.fork. Fixes #156. --- diff --git a/renderer/lib/init.coffee b/renderer/lib/init.coffee index 824dbd2c..84fb257c 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 =