|
@@ -27,7 +27,9 @@ public enum EventBus {
|
27
|
27
|
}
|
28
|
28
|
|
29
|
29
|
public void post(Event event) {
|
30
|
|
- for (WeakReference<Subscriber> ref : subscribers) {
|
|
30
|
+ ListIterator<WeakReference<Subscriber>> iterator = subscribers.listIterator();
|
|
31
|
+ while (iterator.hasNext()) {
|
|
32
|
+ WeakReference<Subscriber> ref = iterator.next();
|
31
|
33
|
Subscriber registered = ref.get();
|
32
|
34
|
if (registered != null) {
|
33
|
35
|
registered.onEvent(event);
|