clone listeners array before calling callbacks - see #464

git-svn-id: http://svn.openlayers.org/trunk/openlayers@2164 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2007-01-19 19:41:51 +00:00
parent 9251b830c3
commit c12a92f938

View File

@@ -272,7 +272,10 @@ OpenLayers.Events.prototype = {
evt.element = this.element;
// execute all callbacks registered for specified type
var listeners = this.listeners[type];
// get a clone of the listeners array to
// allow for splicing during callbacks
var listeners = (this.listeners[type]) ?
this.listeners[type].slice() : null;
if ((listeners != null) && (listeners.length > 0)) {
for (var i = 0; i < listeners.length; i++) {
var callback = listeners[i];