From cb74210cd866574148b61485abdec8d4466f1da2 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Fri, 2 Oct 2020 00:23:01 -0400 Subject: [PATCH] Ensure synchronous shutdown if the user kills the process. --- .../java/com/velocitypowered/proxy/VelocityServer.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java b/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java index 6fa6223ae..54c446a88 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java @@ -456,8 +456,12 @@ public class VelocityServer implements ProxyServer, ForwardingAudience { } }; - Thread thread = new Thread(shutdownProcess); - thread.start(); + if (explicitExit) { + Thread thread = new Thread(shutdownProcess); + thread.start(); + } else { + shutdownProcess.run(); + } } /**