public void removeConfigSelectionListener(IConfigSelectionListener listener) {
if (listeners != null) {
synchronized (listeners) {
List<WeakReference<IConfigSelectionListener>> toRemove = new ArrayList<WeakReference<IConfigSelectionListener>>();
for (WeakReference<IConfigSelectionListener> ref : listeners) {
IConfigSelectionListener temp = ref.get();
if ((temp == null) || temp.equals(listener)) {
toRemove.add(ref);
}
}
listeners.removeAll(toRemove);
toRemove.clear();