mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-24 03:05:49 +01:00
#2520: Fix ConcurrentModificationException when tasks are cancelled during shutdown
This commit is contained in:
parent
1bb826109c
commit
16b3490576
@ -62,9 +62,12 @@ public class BungeeScheduler implements TaskScheduler
|
|||||||
public int cancel(Plugin plugin)
|
public int cancel(Plugin plugin)
|
||||||
{
|
{
|
||||||
Set<ScheduledTask> toRemove = new HashSet<>();
|
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 )
|
for ( ScheduledTask task : toRemove )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user