summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2012-04-10 17:02:50 +0100
committerElgarL <ElgarL@palmergames.com>2012-04-10 17:02:50 +0100
commitf02691863ba41d648c31a7167ed2a6fd3fe57bcd (patch)
treea6b7247cc6b41d8463a518a9817829b7630540bc /EssentialsGroupManager
parentec4f5cc34d2d2bd4556e092e70192a78cd7d1b0f (diff)
downloadEssentials-f02691863ba41d648c31a7167ed2a6fd3fe57bcd.tar
Essentials-f02691863ba41d648c31a7167ed2a6fd3fe57bcd.tar.gz
Essentials-f02691863ba41d648c31a7167ed2a6fd3fe57bcd.tar.lz
Essentials-f02691863ba41d648c31a7167ed2a6fd3fe57bcd.tar.xz
Essentials-f02691863ba41d648c31a7167ed2a6fd3fe57bcd.zip
Properly fix concurrent modification when removing all attachments.
Diffstat (limited to 'EssentialsGroupManager')
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java
index 51f019efc..516679544 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java
@@ -357,7 +357,7 @@ public class BukkitPermissions {
} catch (IllegalArgumentException e) {
/*
* Failed to remove attachment
- * This usually means Bukkit no longer know of it.
+ * This usually means Bukkit no longer knows of it.
*/
}
attachments.remove(player);
@@ -372,8 +372,17 @@ public class BukkitPermissions {
Iterator<Player> itr = attachments.keySet().iterator();
while (itr.hasNext()){
- removeAttachment(itr.next());
+ Player player = itr.next();
+ try {
+ player.removeAttachment(attachments.get(player));
+ } catch (IllegalArgumentException e) {
+ /*
+ * Failed to remove attachment
+ * This usually means Bukkit no longer knows of it.
+ */
+ }
}
+ attachments.clear();
}
/**