diff --git a/src/org/openstreetmap/josm/tools/ListenerList.java b/src/org/openstreetmap/josm/tools/ListenerList.java
index 0124811..3b045f0 100644
|
a
|
b
|
public class ListenerList<T> {
|
| 149 | 149 | for (Iterator<WeakListener<T>> iterator = weakListeners.iterator(); iterator.hasNext();) { |
| 150 | 150 | WeakListener<T> weakLink = iterator.next(); |
| 151 | 151 | T l = weakLink.listener.get(); |
| 152 | | if (l == null) { |
| 153 | | iterator.remove(); |
| 154 | | } else { |
| | 152 | if (l != null) { |
| | 153 | // cleanup during add() should be enough to not cause memory leaks |
| | 154 | // therefore, we ignore null listeners. |
| 155 | 155 | eventFirerer.fire(l); |
| 156 | 156 | } |
| 157 | 157 | } |