         if loadSettings = window.getLoadSettings()
           states.push(initialPaths: loadSettings.initialPaths)
     @storageFolder.store('application.json', states)
+
+  hasEditorWindows: ->
+    @windows.some (window) -> not window.isSpec
 
   loadState: ->
     if (states = @storageFolder.load('application.json'))?.length > 0

      @deleteSocketFile()

    app.on 'will-exit', =>
      @saveState() unless @windows.every (window) -> window.isSpec
      @killAllProcesses()
      @deleteSocketFile()


    @openPathOnEvent('application:open-license', path.join(process.resourcesPath, 'LICENSE.md'))

    app.on 'before-quit', =>
      @saveState() if @hasEditorWindows()
      @quitting = true

    app.on 'will-quit', =>
