Destroy folds when DisplayBuffer is destroyed

Fixes #4562
This commit is contained in:
Nathan Sobo
2015-07-27 12:04:46 -06:00
parent 29a1fbc45f
commit 2d25301ea0
2 changed files with 2 additions and 0 deletions

View File

@@ -4013,6 +4013,7 @@ describe "TextEditor", ->
describe ".destroy()", ->
it "destroys all markers associated with the edit session", ->
editor.foldAll()
expect(buffer.getMarkerCount()).toBeGreaterThan 0
editor.destroy()
expect(buffer.getMarkerCount()).toBe 0

View File

@@ -1173,6 +1173,7 @@ class DisplayBuffer extends Model
return
destroyed: ->
fold.destroy() for markerId, fold of @foldsByMarkerId
marker.disposables.dispose() for id, marker of @markers
@scopedConfigSubscriptions.dispose()
@disposables.dispose()