fix(win): When windows are removed, keep ivars in sync

This commit is contained in:
Ben Gotow 2015-10-22 15:57:34 -07:00
parent e0ddfb736d
commit a3dbab332e

View file

@ -422,6 +422,10 @@ class WindowManager
# Public: Removes the {AtomWindow} from the global window list.
removeWindow: (window) ->
@_windows.splice @_windows.indexOf(window), 1
if window is @_mainWindow
@_mainWindow = null
if window is @_workWindow
@_workWindow = null
@applicationMenu?.enableWindowSpecificItems(false) if @_windows.length == 0
@windowClosedOrHidden()