   didDestroyPane: (event) ->
     @emitter.emit 'did-destroy-pane', event
 
-  # Called by Model superclass when destroyed
-  destroyed: ->
-    @cancelStoppedChangingActivePaneItemTimeout()
-    pane.destroy() for pane in @getRoot().getPanes()
-    @subscriptions.dispose()
-    @emitter.dispose()
-
   cancelStoppedChangingActivePaneItemTimeout: ->
     if @stoppedChangingActivePaneItemTimeout?
       clearTimeout(@stoppedChangingActivePaneItemTimeout)


  getElement: ->
    @element ?= new PaneContainerElement().initialize(this, {views: @viewRegistry})

  serialize: (params) ->
    deserializer: 'PaneContainer'

PaneContainerElement = require './pane-container-element'

module.exports =
class PaneContainer
  serializationVersion: 1
  root: null
  stoppedChangingActivePaneItemDelay: 100
  stoppedChangingActivePaneItemTimeout: null

  constructor: (params) ->
    {@config, applicationDelegate, notificationManager, deserializerManager, @viewRegistry, @location} = params
    @emitter = new Emitter
    @subscriptions = new CompositeDisposable
    @itemRegistry = new ItemRegistry
    @alive = true

    @setRoot(new Pane({container: this, @config, applicationDelegate, notificationManager, deserializerManager, @viewRegistry}))
    @setActivePane(@getRoot())
