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 #9067 from atom/as-memory-leaks
Browse files Browse the repository at this point in the history
Avoid leaking DOM objects
  • Loading branch information
Nathan Sobo committed Oct 7, 2015
2 parents 5e78ead + 8da8302 commit 993419f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/scrollbar-component.coffee
Expand Up @@ -12,6 +12,9 @@ class ScrollbarComponent

@domNode.addEventListener 'scroll', @onScrollCallback

destroy: ->
@onScroll = null

getDomNode: ->
@domNode

Expand Down
8 changes: 7 additions & 1 deletion src/text-editor-component.coffee
Expand Up @@ -119,6 +119,12 @@ class TextEditorComponent
@gutterContainerComponent?.destroy()
@domElementPool.clear()

@verticalScrollbarComponent.destroy()
@horizontalScrollbarComponent.destroy()

@onVerticalScroll = null
@onHorizontalScroll = null

getDomNode: ->
@domNode

Expand Down Expand Up @@ -563,7 +569,7 @@ class TextEditorComponent
@sampleBackgroundColors()
@remeasureCharacterWidths()

handleDragUntilMouseUp: (dragHandler) =>
handleDragUntilMouseUp: (dragHandler) ->
dragging = false
lastMousePosition = {}
animationLoop = =>
Expand Down
2 changes: 1 addition & 1 deletion src/text-editor-presenter.coffee
Expand Up @@ -129,7 +129,7 @@ class TextEditorPresenter
@shouldUpdateCustomGutterDecorationState = true
@emitDidUpdateState()

@model.onDidUpdateMarkers =>
@disposables.add @model.onDidUpdateMarkers =>
@shouldUpdateLinesState = true
@shouldUpdateLineNumbersState = true
@shouldUpdateDecorations = true
Expand Down

0 comments on commit 993419f

Please sign in to comment.