instantiated views referenced from inside an #if block only get properly destroyed the first time they are removed #565

Merged
merged 1 commit into from Sep 27, 2011

Conversation

Projects
None yet
2 participants
@burrows
Contributor

burrows commented Jul 28, 2011

When an already instantiated view is used inside of an #if block its destroy method is called the first time the condition becomes false. Then, when the condition becomes true again, the view is properly re-rendered, however when the condition becomes false once again, the nested view is removed from the document but its willDestroyLayer method is never invoked. I believe that this is happening because the nested view's isDestroyed property is set the first time it is torn down and then never reset.

A failing unit test to demonstrate the issue is attached.

ColinCampbell pushed a commit that referenced this pull request Sep 27, 2011

Colin Campbell
Merge pull request #565 from burrows/template-view-destroy-issue
instantiated views referenced from inside an #if block only get properly destroyed the first time they are removed

@ColinCampbell ColinCampbell merged commit dea8a7a into sproutcore:master Sep 27, 2011

@ColinCampbell

This comment has been minimized.

Show comment Hide comment
@ColinCampbell

ColinCampbell Sep 27, 2011

Contributor

Merging this in, unsure what the fix is but thanks for the failing test!

Contributor

ColinCampbell commented Sep 27, 2011

Merging this in, unsure what the fix is but thanks for the failing test!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment