Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Hopefully fix memory leak with velocity #291

Merged
merged 3 commits into from
May 26, 2016
Merged

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented May 26, 2016

Looks like we should be doing this anyway because apparently you need to blow away the jQuery data manually if your DOM nodes are not removed using jQuery's node.remove()...

@richvdh
Copy link
Member

richvdh commented May 26, 2016

apparently you need to blow away the jQuery data manually

huh? We aren't using jquery are we?

@@ -25,6 +25,10 @@ module.exports = React.createClass({
this._updateChildren(this.props.children);
},

componentWillUnmount: function() {
this._updateChildren([]);
Copy link
Member

Choose a reason for hiding this comment

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

surely this doesn't do anything? it just sets this.children = {}, which has no effect, because render won't be called again? Or am I missing something

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually yes, this shouldn't be necessary.

@richvdh richvdh assigned dbkr and unassigned richvdh May 26, 2016
@dbkr
Copy link
Member Author

dbkr commented May 26, 2016

We're not using jQuery, but Velocity does (or in this case it uses its own, small jQuery replacement which stores data alongside elements in a compatible way.

@dbkr
Copy link
Member Author

dbkr commented May 26, 2016

ptal

@dbkr dbkr assigned richvdh and unassigned dbkr May 26, 2016
@richvdh
Copy link
Member

richvdh commented May 26, 2016

lgtm

@richvdh richvdh assigned dbkr and unassigned richvdh May 26, 2016
@dbkr dbkr merged commit 0a2d014 into develop May 26, 2016
@richvdh richvdh deleted the dbkr/velocity_memory_leak branch February 15, 2017 13:16
@jryans jryans added the memory label Feb 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants