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 9a7fc6e71141fb06a129278a45cc5ec850e8cf8f..d0ec41c4d23c6e79eda0ae647cb9ec1108e560f3 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 9487849e5e693bcca539de1c1634ce1a2cc51cce..41cd6fb22ca24c8d40be0f2a62964a2240dc2c87 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'