Return empty array from getPanes when PaneContainer is destroyed

Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
This commit is contained in:
Nathan Sobo
2016-09-13 11:01:40 -06:00
committed by Max Brunsfeld
parent 283a573ce5
commit 8a12be9a8d

View File

@@ -102,7 +102,10 @@ class PaneContainer extends Model
@setRoot(newChild)
getPanes: ->
@getRoot().getPanes()
if @alive
@getRoot().getPanes()
else
[]
getPaneItems: ->
@getRoot().getItems()
@@ -195,7 +198,7 @@ class PaneContainer extends Model
# Called by Model superclass when destroyed
destroyed: ->
@cancelStoppedChangingActivePaneItemTimeout()
pane.destroy() for pane in @getPanes()
pane.destroy() for pane in @getRoot().getPanes()
@subscriptions.dispose()
@emitter.dispose()