swiz/swiz-framework — Issue #34: Swiz teardown does not remove SwizEvent.CREATED listener
Author: bclinkinbeard
Created: 2011-12-19 19:07:34+00:00
State: open

**Migrated from SWIZ-67**

When teardown is called on a swiz instance (either through SwizManager or Swiz.tearDown), the swiz instance is pinned in memory because an event listener is not removed. If a new swiz instance is created after, the new swiz instance will use the torn down one as the parent.

Swiz.as line 414: dispatcher.addEventListener( SwizEvent.CREATED, handleSwizCreatedEvent );

A possible solution is to add to the teardown method:
```dispatcher.removeEventListener( SwizEvent.CREATED, handleSwizCreatedEvent );```