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

[BUGFIX release] Fix container destroy timing #16754

Merged
merged 3 commits into from
Jun 20, 2018

Conversation

wagenet
Copy link
Member

@wagenet wagenet commented Jun 18, 2018

No description provided.

Copy link
Member

@rwjblue rwjblue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to tweak some other parts of the container destroy lifecycle also here, I'll get those changes pushed up into this PR shortly...

@@ -101,7 +101,7 @@ let containerProxyMixin = {
this._super(...arguments);

if (this.__container__) {
run(this.__container__, 'destroy');
schedule('destroy', this.__container__, 'destroy');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think more join like behavior?

@krisselden
Copy link
Contributor

Separate destroying each destroyable (should be synchronous, from finalizing the container should be destroy queue).

destroy() {
join(() => { container.eachDestroyable(), schedule('destroy', container, 'finalizeDestroy') })
}

wagenet and others added 2 commits June 18, 2018 12:44
Ensure `.destroy()` is called on all items in the container, _before_
marking `container.isDestroyed`. Only flush the caches after destroy is
finalized.
@rwjblue
Copy link
Member

rwjblue commented Jun 20, 2018

Just pushed an update that should address the concerns that @krisselden / @stefanpenner brought up.

Should be good to land once green...

@rwjblue rwjblue changed the title Fix container destroy timing [BUGFIX release] Fix container destroy timing Jun 20, 2018
Copy link
Member Author

@wagenet wagenet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok. Only point of confusion I had is that finalizeDestroy isn't automatically called. Is that as expected? Obviously, this is internal API, but I could see someone potentially calling only destroy and never calling finalizeDestroy.

@rwjblue rwjblue merged commit bd71b96 into emberjs:master Jun 20, 2018
@rwjblue
Copy link
Member

rwjblue commented Jun 20, 2018

Only point of confusion I had is that finalizeDestroy isn't automatically called. Is that as expected? Obviously, this is internal API, but I could see someone potentially calling only destroy and never calling finalizeDestroy.

@wagenet - The container itself is not actually exposed, any user-land code calling .destroy() would be on the "owner" which is exactly the thing that mixes in ContainerProxyMixin and gets the destroy implementation in this PR.

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

Successfully merging this pull request may close these issues.

4 participants