mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Dispose nodes associated with a LineComponent when replacing it
This commit is contained in:
@@ -3453,12 +3453,7 @@ class LinesTileComponent {
|
||||
textNodesByScreenLineId
|
||||
})
|
||||
this.element.insertBefore(newScreenLineComponent.element, oldScreenLineComponent.element)
|
||||
// Instead of calling destroy on the component here we can simply
|
||||
// remove its associated element, thus skipping the
|
||||
// lineNodesByScreenLineId bookkeeping. This is possible because
|
||||
// lineNodesByScreenLineId has already been updated when creating the
|
||||
// new screen line component.
|
||||
oldScreenLineComponent.element.remove()
|
||||
oldScreenLineComponent.destroy()
|
||||
this.lineComponents[lineComponentIndex] = newScreenLineComponent
|
||||
|
||||
oldScreenLineIndex++
|
||||
|
||||
Reference in New Issue
Block a user