 
     close: () ->
       @empty()
-      delete @[key] for key of @
+      cleanObject()
 
   class Regions
     constructor: (regions = {}, $context) ->

  _ = require('underscore')
  Backbone = require('backbone')
  settings = require('cs!settings')

  class Region
    constructor: (@el, @parent) ->

      @_renderDom(data)

    render: () ->
      @onBeforeRender()
      @_render()
      @onRender()
      if @_rendered then @onDomRefresh?() else @_rendered = true

      return @

    onShow: () -> # noop
    onBeforeRender: () -> # noop
    onRender: () -> # noop
    onBeforeClose: () -> # noop

    close: () ->
      @onBeforeClose()

      _.each @regions, (region) ->
        region.close()

      @remove()
      @unbind()
      cleanObject()
      return @
