Bean incorrectly torn down when moved inside module

Description

Hi,

I've created a view inside a module. This view is incorrectly torn down, when the layout manager removes and adds the view within one frame.

My analysis goes as follows:

  • view is added and correctly wired by the modules swiz instance

  • view gets removed and both swiz instances (module and app) register onEnterFrame to tear down the view <-- this is the bug

  • view gets readded and only the modules swiz instance removes the onEnterFrame handler. This is because BeanFactory::isPotentialInjectionTarget correctly returns false within BeanFactory::setUpEventHandler for the parent (application) swiz instance

  • view is incorrectly torn down because the parent swiz instance still had the onEnterFrame handler registered

Sorry I didn't have the time to create a TestCase.
A patch to fix the problem is attached.

Regards Stefan

Environment

Flex 4.5 (but that doesn't matter)

Status

Assignee

ChrisC

Reporter

Stefan Klug

Labels

None

Fix versions

Affects versions

Priority

Major
Configure