From fc724b51e8c206fe10a648bfd73ad0593e277601 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 9 Dec 2015 18:11:38 -0800 Subject: [PATCH] Move event forwarding back to init --- atom/browser/api/lib/app.coffee | 7 ------- atom/browser/lib/init.coffee | 6 ++++++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/atom/browser/api/lib/app.coffee b/atom/browser/api/lib/app.coffee index 9a7fc6e71141..d0ec41c4d23c 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 9487849e5e69..41cd6fb22ca2 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'