   removeItem: (item, destroyed=false) ->
     index = @items.indexOf(item)
     return if index is -1
+
+    if typeof item.on is 'function'
+      @unsubscribe item
+
     if item is @activeItem
       if @items.length is 1
         @setActiveItem(undefined)

  addItem: (item, index=@getActiveItemIndex() + 1) ->
    return if item in @items

    @items.splice(index, 0, item)
    @emit 'item-added', item, index
    @emitter.emit 'did-add-item', {item, index}

{find, compact, extend, last} = require 'underscore-plus'
{Model} = require 'theorist'
{Emitter} = require 'event-kit'
Serializable = require 'serializable'
PaneAxis = require './pane-axis'
