Fix issues cleaning up after repeating tasks.
A mass of NullPointerExceptions would be outputted when tasks were stopped. This is resolved by checking if we are still running (indicating a possible scheduler cancel) before telling the scheduler to pull the plug. Ideally, the entire BungeeCord scheduler should be rewritten. It has quite a few issues which could be avoided with a new system.
This commit is contained in:
parent
02d3660f32
commit
36c4af35de
@ -76,6 +76,11 @@ public class BungeeTask implements Runnable, ScheduledTask
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sched.cancel( this );
|
// We might have been previously running before, but now we aren't.
|
||||||
|
// If we weren't already cancelled, then cancel ourselves.
|
||||||
|
if ( running.get() )
|
||||||
|
{
|
||||||
|
sched.cancel( this );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user