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

Fix memory leak using custom BUILTIN_MODIFIERS object, fix #28 #29

Merged
merged 1 commit into from
Jul 19, 2018

Conversation

bobisjan
Copy link
Contributor

No description provided.

@bobisjan
Copy link
Contributor Author

I'm not sure if this is a correct fix of memory leak in #28, but it removes it in our application.

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.

Great job tracking this down!! Thank you so much for digging into it!

@@ -95,6 +95,10 @@ import { lte, gte } from 'ember-compatibility-helpers';
}
}

runtimeResolver.builtInModifiers = {
Copy link
Member

Choose a reason for hiding this comment

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

Can you tweak this slightly to:

runtimeResolver.builtInModifiers = Ember.assign({}, runtimeResolver.builtInModifiers);

I believe it should have the same benefit (not mutating the global state), but also preserve any other items in the built in modifiers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, will do.

BTW I've found another leak with CURLY_COMPONENT_MANAGER few lines below (https://github.com/rwjblue/ember-angle-bracket-invocation-polyfill/blob/master/vendor/angle-bracket-invocation-polyfill/runtime-polyfill.js#L166-L169), I can update this PR (or create a new one) with something like

let customManager = Ember.assign({}, manager);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated the PR, but left CURLY_COMPONENT_MANAGER issue to a separate investigation.

Copy link
Member

Choose a reason for hiding this comment

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

Ya, updating CURLY_COMPONENT_MANAGER does make sense to me but I'm happy to just review that in a separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I'll try to provide a separate PR, right now I'm still facing with CURLY_COMPONENT_MANAGER leak, because using Ember.assign breaks setting attributes on components from parent template.

@rwjblue
Copy link
Member

rwjblue commented Jul 18, 2018

restarted CI (failures seem unrelated)

@rwjblue rwjblue merged commit 759675d into ember-polyfills:master Jul 19, 2018
@bobisjan bobisjan deleted the memory-leak-fix branch July 19, 2018 15:53
@ryanto
Copy link

ryanto commented Jul 19, 2018

wow nice job @bobisjan 🎉

@rwjblue rwjblue added the bug Something isn't working label Sep 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants