Refactor event manager to remove memory leaks

This commit is contained in:
Andreas Hocevar
2016-01-30 15:29:44 +01:00
parent d7497f9686
commit c51d717657
6 changed files with 207 additions and 151 deletions
+4 -4
View File
@@ -286,14 +286,14 @@ describe('ol.layer.Group', function() {
var listeners = layerGroup.listenerKeys_[goog.getUid(layer)];
expect(listeners.length).to.eql(2);
expect(typeof listeners[0]).to.be('string');
expect(typeof listeners[1]).to.be('string');
expect(typeof listeners[0]).to.be('object');
expect(typeof listeners[1]).to.be('object');
// remove the layer from the group
layers.pop();
expect(goog.object.getCount(layerGroup.listenerKeys_)).to.eql(0);
expect(ol.events.listenersByKey_[listeners[0]]).to.be(undefined);
expect(ol.events.listenersByKey_[listeners[1]]).to.be(undefined);
expect(listeners[0].listener).to.be(undefined);
expect(listeners[1].listener).to.be(undefined);
});
});