public function doAddItem(itemConcepto:int):void{
modalCfd = new modalCFDItems();
modalCfd.addEventListener(Event.CLOSE, closeHandler);
modalCfd.addEventListener("addItemResult", addItem_resultHandler);
modalCfd.addEventListener("addItemResize", addItemResize_resultHandler);
PopUpManager.addPopUp(modalCfd, this, true)
PopUpManager.centerPopUp(modalCfd);
}
private function addItem_resultHandler(event:Event):void{
addItemStuff();
PopUpManager.removePopUp(modalCfd);
removeListeners("modalCfd");
}
Does that do it, or do I have to removeEventListener explicitly?
You have to always remove listeners if you want the GC to kick in.
There is just no way around it.
And also NULL the object is best too.