-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swiz teardown sets up prototype beans that have event handlers #36
Comments
There is a pull request that fixes this issue, why hasn't this been pulled yet? It's over 4 months old at this point. |
Could this pull request be integrated to the project? |
Hey Joao, I'm afraid it would be something Ben or Chris would have to do. On Wed, Apr 18, 2012 at 9:51 AM, joaofernandes <
|
I also ran into this with Prototypes that have [Inject] tags in a project using Modules (where the Module Swiz teardowns are quite common, since we load and unload the modules frequently). It looks to me like this line causes the problem: as the .source accessor calls getObject() which causes the Prototype to be instantiated. |
Migrated from SWIZ-66
When calling swiz.teardown(), prototype beans that have event handlers get constructed. Attached is a sample application to demonstrate the problem.
It's happening in EventHandlerProcessor.as on line 114. When trying to remove event handlers, it calls bean.source which has a getter with logic to setup the bean if it is not set up yet.
From @brian428
While I don't believe you should be calling teardown() directly, it does look like this would affect most of the processors. Possible fix in BeanFactory:
Jeffrey Barrus added a comment - 14/Nov/11 4:54 PM
I found the problem because I am trying to do some integration testing and I really need to teardown everything between tests. I know the AutowiredTestCase uses a swiz instance as the event dispatcher rather than the top level application but I have created a FlexUnit Rule instead of using the AutowiredTestCase and I am using the top level application as the dispatcher. Is there a better way for me to tear down everything? When does swiz.teardown() get called normally?
The text was updated successfully, but these errors were encountered: