mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Properly exit when render process crashes if exitWhenDone option is true
Previously, we were referring to an undefined `atom` global to exit when the render process crashed in specs. Now we only exit when exitWhenDone is true, which will only exit in headless specs. Also, we now call .exit on an object that's actually defined.
This commit is contained in:
@@ -52,6 +52,8 @@ class AtomApplication
|
||||
resourcePath: null
|
||||
version: null
|
||||
|
||||
exit: (status) -> app.exit(status)
|
||||
|
||||
constructor: (options) ->
|
||||
{@resourcePath, @version, @devMode} = options
|
||||
global.atomApplication = this
|
||||
|
||||
@@ -18,7 +18,7 @@ class AtomWindow
|
||||
isSpec: null
|
||||
|
||||
constructor: (settings={}) ->
|
||||
{@resourcePath, pathToOpen, initialLine, @isSpec} = settings
|
||||
{@resourcePath, pathToOpen, initialLine, @isSpec, @exitWhenDone} = settings
|
||||
global.atomApplication.addWindow(this)
|
||||
|
||||
@setupNodePath(@resourcePath)
|
||||
@@ -82,7 +82,7 @@ class AtomWindow
|
||||
@browserWindow.destroy() if chosen is 0
|
||||
|
||||
@browserWindow.on 'crashed', =>
|
||||
atom.exit(100) if @isSpec
|
||||
global.atomApplication.exit(100) if @exitWhenDone
|
||||
|
||||
chosen = dialog.showMessageBox @browserWindow,
|
||||
type: 'warning'
|
||||
|
||||
Reference in New Issue
Block a user