Make sure window.shutdown is only called once

This commit is contained in:
Corey Johnson & Nathan Sobo
2013-02-20 10:18:19 -08:00
parent 43aa1aaeb7
commit b24a13991a
2 changed files with 9 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ require 'underscore-extensions'
require 'space-pen-extensions'
deserializers = {}
wasShutdown = false
windowAdditions =
rootViewParentSelector: 'body'
@@ -68,6 +69,8 @@ windowAdditions =
$(rootViewParentSelector).append(rootView)
shutdown: ->
return if wasShutdown
wasShutdown = true
atom.setWindowState('pathToOpen', project.getPath())
atom.setRootViewStateForPath project.getPath(),
project: project.serialize()