I add an instance of this module to the dispay list and then remove it.
Will the event listener attached to foo create a leak?
A simplified module:
<s:Module creationComplete="init()">
<fx:Script>
protected var foo:Bar = new Bar();
protected function init() {
foo.addEventListener(MouseEvent.CLICK, foo_clickHandler);
}
protected function foo_clickHandler(event:MouseEvent):void {
//do something
}
</fx:Script>
</s:Module>
This module does not have memory leaks since you add listener to a local object, not to a
Stage,StyleManageror some other global-accessible stuff.