Move event forwarding back to init
authorKevin Sawicki <kevinsawicki@gmail.com>
Thu, 10 Dec 2015 02:11:38 +0000 (18:11 -0800)
committerKevin Sawicki <kevinsawicki@gmail.com>
Thu, 10 Dec 2015 02:11:38 +0000 (18:11 -0800)
atom/browser/api/lib/app.coffee
atom/browser/lib/init.coffee

index 9a7fc6e..d0ec41c 100644 (file)
@@ -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) ->
index 9487849..41cd6fb 100644 (file)
@@ -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'