From: Kevin Sawicki Date: Thu, 10 Dec 2015 02:11:38 +0000 (-0800) Subject: Move event forwarding back to init X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fc724b51e8c206fe10a648bfd73ad0593e277601;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git Move event forwarding back to init --- diff --git a/atom/browser/api/lib/app.coffee b/atom/browser/api/lib/app.coffee index 9a7fc6e..d0ec41c 100644 --- a/atom/browser/api/lib/app.coffee +++ b/atom/browser/api/lib/app.coffee @@ -34,13 +34,6 @@ app.setAppPath = (path) -> app.getAppPath = -> appPath -# Map process.exit to app.exit, which quits gracefully. -process.exit = app.exit - -# Emit a process 'exit' event on app quit. -app.on 'quit', (event, exitCode) -> - process.emit 'exit', exitCode - # Routes the events to webContents. for name in ['login', 'certificate-error', 'select-client-certificate'] do (name) -> diff --git a/atom/browser/lib/init.coffee b/atom/browser/lib/init.coffee index 9487849..41cd6fb 100644 --- a/atom/browser/lib/init.coffee +++ b/atom/browser/lib/init.coffee @@ -51,7 +51,13 @@ process.on 'uncaughtException', (error) -> message = "Uncaught Exception:\n#{stack}" dialog.showErrorBox 'A JavaScript error occurred in the main process', message +# Emit a process 'exit' event on app quit. {app} = require 'electron' +app.on 'quit', (event, exitCode) -> + process.emit 'exit', exitCode + +# Map process.exit to app.exit, which quits gracefully. +process.exit = app.exit # Load the RPC server. require './rpc-server'