Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Commit

Permalink
Merge pull request #8095 from atom/ns-destroy-folds
Browse files Browse the repository at this point in the history
Destroy folds when DisplayBuffer is destroyed
  • Loading branch information
Nathan Sobo committed Jul 27, 2015
2 parents 29a1fbc + 2d25301 commit a4325e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions spec/text-editor-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/display-buffer.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit a4325e3

Please sign in to comment.