-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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] Clear chains in ProxyMixin when destroyed #16860
Conversation
@@ -61,6 +61,11 @@ export default Mixin.create({ | |||
m.writableTag(() => combine([DirtyableTag.create(), UpdatableTag.create(CONSTANT_TAG)])); | |||
}, | |||
|
|||
destroy() { | |||
this._super(...arguments); | |||
this.set('content', null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to set the content before supering. Do you see any issues with that?
@rwjblue no problem, just left on a long weekend, will do it next Thursday
Op vr 3 aug. 2018 16:05 schreef Robert Jackson <notifications@github.com>:
… ***@***.**** commented on this pull request.
------------------------------
In packages/ember-runtime/lib/mixins/-proxy.js
<#16860 (comment)>:
> @@ -61,6 +61,11 @@ export default Mixin.create({
m.writableTag(() => combine([DirtyableTag.create(), UpdatableTag.create(CONSTANT_TAG)]));
},
+ destroy() {
+ this._super(...arguments);
+ this.set('content', null);
I'd prefer to set the content before supering. Do you see any issues with
that?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#16860 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGwv8hD0MW9757n8Qkz0g6OtAZX4gID-ks5uNFiKgaJpZM4Vt37u>
.
|
Awesome, enjoy!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
destroy should use ember set only willDestroy, destroy is only supposed to mark is destroying and schedule willDestroy which can set
Sorry for the delays, the repo reorganization has caused conflicts here would you mind rebasing? |
rebased |
When a ObjectProxy is destroyed while the proxied object is still alive, then the ObjectProxy is leaked because the chains attached to the proxied object retains the ObjectProxy.
This is an issue for us, as ember-data uses proxies for their belongsTo relationships. (See emberjs/data#5554 for more information)
A sample program that demonstrates this can be found at https://github.com/pieter-v/ember-proxy-leak
A memory snapshot before this fix:
A memory snapshot after this fix: