Merge pull request #6785 from atom/mb-fix-reopen-windows

Avoid saving window state when closing windows after quitting
This commit is contained in:
Max Brunsfeld
2015-05-14 09:54:14 -07:00

View File

@@ -56,6 +56,7 @@ class AtomApplication
atomProtocolHandler: null
resourcePath: null
version: null
quitting: false
exit: (status) -> app.exit(status)
@@ -104,7 +105,7 @@ class AtomApplication
if process.platform in ['win32', 'linux']
app.quit()
return
@saveState() unless window.isSpec
@saveState() unless window.isSpec or @quitting
# Public: Adds the {AtomWindow} to the global window list.
addWindow: (window) ->
@@ -208,6 +209,9 @@ class AtomApplication
@openPathOnEvent('application:open-your-stylesheet', 'atom://.atom/stylesheet')
@openPathOnEvent('application:open-license', path.join(process.resourcesPath, 'LICENSE.md'))
app.on 'before-quit', =>
@quitting = true
app.on 'will-quit', =>
@killAllProcesses()
@deleteSocketFile()