Merge pull request #12645 from atom/as-fix-app-not-quitting-on-windows-and-linux

Fix app not quitting on win32 and linux when closing the last window
This commit is contained in:
Antonio Scandurra
2016-09-09 17:57:57 +02:00
committed by GitHub
2 changed files with 44 additions and 4 deletions

View File

@@ -122,12 +122,12 @@ class AtomApplication
# Public: Removes the {AtomWindow} from the global window list.
removeWindow: (window) ->
if @windows.length is 1
@windows.splice(@windows.indexOf(window), 1)
if @windows.length is 0
@applicationMenu?.enableWindowSpecificItems(false)
if process.platform in ['win32', 'linux']
app.quit()
return
@windows.splice(@windows.indexOf(window), 1)
@saveState(true) unless window.isSpec
# Public: Adds the {AtomWindow} to the global window list.