Skip to content
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

Views set up manually with BeanEvent.SET_UP_BEAN are not automatically torn down #29

Open
bclinkinbeard opened this issue Dec 19, 2011 · 0 comments

Comments

@bclinkinbeard
Copy link
Contributor

Migrated from SWIZ-60

Going through SET_UP_BEAN does not add the view to the wired views map, so when it is removed from stage it will not be automatically torn down because it's not in wiredViews.

Possible fix in handleBeanEvent():

case BeanEvent.SET_UP_BEAN:
    if( existingBean )
        if( existingBean.initialized )
            logger.warn( "{0} is already set up as a bean. Ignoring SET_UP_BEAN request.", event.source.toString() );
        else if( event.source is DisplayObject && event.source is ISetUpValidator )
            SwizManager.setUp( DisplayObject( event.source) );
        else
            setUpBean( existingBean );
    else
        setUpBean( constructBean( event.source, event.beanName, swiz.domain ) );
    break;

Which would seem to work since SwizManager.setUp() won't do anything with the view if it is already in the wired views list, and assuming that a DisplayObject implementing ISetUpValidator is infered to be a view that the developer is attempting to manually set up themselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant