From f02691863ba41d648c31a7167ed2a6fd3fe57bcd Mon Sep 17 00:00:00 2001 From: ElgarL Date: Tue, 10 Apr 2012 17:02:50 +0100 Subject: Properly fix concurrent modification when removing all attachments. --- .../groupmanager/permissions/BukkitPermissions.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'EssentialsGroupManager') 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 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(); } /** -- cgit v1.2.3