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 when removing layers from ol.layer.Group #3528

Merged
merged 2 commits into from
Apr 20, 2015

Conversation

fredj
Copy link
Member

@fredj fredj commented Apr 9, 2015

Fixes #3479

layer, [ol.ObjectEventType.PROPERTYCHANGE, goog.events.EventType.CHANGE],
this.handleLayerChange_, false, this);
var key = goog.getUid(layer).toString();
goog.asserts.assert(!goog.isDef(this.listenerKeys_[key]),
Copy link
Member

Choose a reason for hiding this comment

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

Using goog.asserts.assert(!(key in this.listenerKeys_)) would make more sense to me.

@elemoine
Copy link
Member

elemoine commented Apr 9, 2015

I've added a few minor comments. I'd also recommend adding unit-tests to check that that logic is correct and avoid regressions in the future.

@fredj
Copy link
Member Author

fredj commented Apr 9, 2015

@elemoine you're right; units tests must be added.

@fredj
Copy link
Member Author

fredj commented Apr 14, 2015

More unit tests added

@fredj fredj added this to the v3.5.0 milestone Apr 16, 2015
@elemoine
Copy link
Member

+1

fredj added a commit that referenced this pull request Apr 20, 2015
Fix memory leak when removing layers from ol.layer.Group
@fredj fredj merged commit cb4fd37 into openlayers:master Apr 20, 2015
@fredj fredj deleted the layer-group-leak branch April 20, 2015 07:51
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.

Memory Leak with adding and removing layers from a layer group.
2 participants