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:
Kevin Sawicki
2013-11-21 13:04:45 -08:00
parent e225dbe93d
commit cdc7f70b22
2 changed files with 2 additions and 2 deletions

View File

@@ -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 = []

View File

@@ -86,7 +86,7 @@ class TextBuffer extends telepath.Model
@file?.off()
@unsubscribe()
@destroyed = true
@emit 'destroyed'
@emit 'destroyed', this
isRetained: -> @refcount > 0