After each spec runs, make sure there are no subscriptions on directories (which would leak memory)

This commit is contained in:
Nathan Sobo
2012-04-26 15:54:54 -06:00
parent fb6a967a18
commit 47c013f817
4 changed files with 34 additions and 4 deletions

View File

@@ -27,6 +27,10 @@ class TreeView extends View
@on 'tree-view:open-selected-entry', => @openSelectedEntry()
@rootView.on 'active-editor-path-change', => @selectActiveFile()
deactivate: ->
@find('.expanded.directory').each ->
$(this).view().unwatchEntries()
selectActiveFile: ->
activeFilePath = @rootView.activeEditor()?.buffer.path
@selectEntry(@find(".file[path='#{activeFilePath}']"))