From: David ‘Bombe’ Roden Date: Mon, 12 May 2008 21:49:12 +0000 (+0000) Subject: fix ConcurrentModificationException X-Git-Tag: v0.1.1~133 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=7fd5e756aaed4ddea02db3d42e49feed86c1b839;p=jFCPlib.git fix ConcurrentModificationException git-svn-id: http://trooper/svn/projects/jFCPlib/branch/high-level-client@854 c3eda9e8-030b-0410-8277-bc7414b0a119 --- diff --git a/src/net/pterodactylus/fcp/highlevel/HighLevelCallback.java b/src/net/pterodactylus/fcp/highlevel/HighLevelCallback.java index ac448a6..541e502 100644 --- a/src/net/pterodactylus/fcp/highlevel/HighLevelCallback.java +++ b/src/net/pterodactylus/fcp/highlevel/HighLevelCallback.java @@ -84,15 +84,17 @@ public class HighLevelCallback { } /** - * Notifies all listeners that the result of the operation is now known. + * Notifies all listeners that the result of the operation is now known. As + * soon as a listener was notified it will be removed from the list of + * listeners! * * @see HighLevelCallbackListener#gotResult(HighLevelCallback) */ private synchronized void fireGotResult() { for (HighLevelCallbackListener highLevelCallbackListener: highLevelCallbackListeners) { - highLevelCallbackListeners.remove(highLevelCallbackListener); highLevelCallbackListener.gotResult(this); } + highLevelCallbackListeners.clear(); } /**