Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Commit

Permalink
SpigotMC#2520: Fix ConcurrentModificationException when tasks are can…
Browse files Browse the repository at this point in the history
…celled during shutdown
  • Loading branch information
JoJoDeveloping authored and md-5 committed Aug 28, 2018
1 parent 1bb8261 commit 16b3490
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,12 @@ public void cancel(ScheduledTask task)
public int cancel(Plugin plugin)
{
Set<ScheduledTask> toRemove = new HashSet<>();
for ( ScheduledTask task : tasksByPlugin.get( plugin ) )
synchronized ( lock )
{
toRemove.add( task );
for ( ScheduledTask task : tasksByPlugin.get( plugin ) )
{
toRemove.add( task );
}
}
for ( ScheduledTask task : toRemove )
{
Expand Down

0 comments on commit 16b3490

Please sign in to comment.