mirror of
https://github.com/atom/atom.git
synced 2026-02-17 10:01:25 -05:00
🚱 Fix mini editor leak
Previously, we were overriding Editor::destroy, which is now provided by telepath. Since the real destroy wasn't being called, we were failing to remove editors associated with mini editor views.
This commit is contained in:
@@ -192,7 +192,7 @@ class Pane extends View
|
||||
handleItemEvents: (item) ->
|
||||
if _.isFunction(item.on)
|
||||
@subscribe item, 'destroyed', =>
|
||||
@destroyItem(item) if @state.isAlive()
|
||||
@destroyItem(item, updateState: false) if @state.isAlive()
|
||||
|
||||
# Public: Remove the currently active item.
|
||||
destroyActiveItem: =>
|
||||
@@ -200,13 +200,13 @@ class Pane extends View
|
||||
false
|
||||
|
||||
# Public: Remove the specified item.
|
||||
destroyItem: (item) ->
|
||||
destroyItem: (item, options) ->
|
||||
@unsubscribe(item) if _.isFunction(item.off)
|
||||
@trigger 'pane:before-item-destroyed', [item]
|
||||
|
||||
if @promptToSaveItem(item)
|
||||
@getContainer()?.itemDestroyed(item)
|
||||
@removeItem(item)
|
||||
@removeItem(item, options)
|
||||
item.destroy?()
|
||||
true
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user