mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Pass buffer from event to TextBuffer::removeBuffer
Previously only the last buffer would be destroyed since the buffer from the loop variable was being used.
This commit is contained in:
@@ -34,7 +34,7 @@ class Project extends telepath.Model
|
||||
# Private: Called by telepath.
|
||||
attached: ->
|
||||
for buffer in @buffers.getValues()
|
||||
buffer.once 'destroyed', => @removeBuffer(buffer)
|
||||
buffer.once 'destroyed', (buffer) => @removeBuffer(buffer)
|
||||
|
||||
@openers = []
|
||||
@editors = []
|
||||
|
||||
@@ -86,7 +86,7 @@ class TextBuffer extends telepath.Model
|
||||
@file?.off()
|
||||
@unsubscribe()
|
||||
@destroyed = true
|
||||
@emit 'destroyed'
|
||||
@emit 'destroyed', this
|
||||
|
||||
isRetained: -> @refcount > 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user