Addepar / ember-charts

https://opensource.addepar.com/ember-charts/
Other
784 stars 131 forks source link

[BUG] Check first if a CP has been computed #234

Closed cyril-sf closed 5 years ago

cyril-sf commented 5 years ago

When removing memory leaks in #231, I assumed that the CPs that were used to attach event handlers were always computed. It turns out it's not the case. In this PR a flag is used to track when an event listener is added, then that same flag is checked to determine if teardown is required.

cyril-sf commented 5 years ago

My 2nd mistake was to believe that the CPs were cached after being computed. It turns out that we use volatile quite a bit, making cacheFor irrelevant.

I'll simply use a flag when adding the event listeners.

mixonic commented 5 years ago

@kpfefferle I updated the description. Merging.