mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-24 03:05:49 +01:00
#2449: Avoid stopping if already in progress
Currently it is possible to stop the proxy multiple times, causing the shutdown routines to be called twice. This doesn't make any sense and may even cause problems with some plugins. Cancel early if stopping is already in progress to avoid this.
This commit is contained in:
parent
ff42394bdb
commit
7410ce9077
@ -379,8 +379,14 @@ public class BungeeCord extends ProxyServer
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop(final String reason)
|
||||
public synchronized void stop(final String reason)
|
||||
{
|
||||
if ( !isRunning )
|
||||
{
|
||||
return;
|
||||
}
|
||||
isRunning = false;
|
||||
|
||||
new Thread( "Shutdown Thread" )
|
||||
{
|
||||
@Override
|
||||
@ -388,8 +394,6 @@ public class BungeeCord extends ProxyServer
|
||||
@SuppressWarnings("TooBroadCatch")
|
||||
public void run()
|
||||
{
|
||||
BungeeCord.this.isRunning = false;
|
||||
|
||||
stopListeners();
|
||||
getLogger().info( "Closing pending connections" );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user