From 87e78bae7ee97d812b4cfbf233e0d583a557324b Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 6 Mar 2013 12:04:25 +1100 Subject: [PATCH] Fix #177 - greload and listeners --- proxy/src/main/java/net/md_5/bungee/BungeeCord.java | 1 + proxy/src/main/java/net/md_5/bungee/ListenThread.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java index be8c54bf1..c9dd9ad0d 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -201,6 +201,7 @@ public class BungeeCord extends ProxyServer $().log( Level.INFO, "Closing listen thread {0}", listener.socket ); try { + listener.interrupt(); listener.socket.close(); listener.join(); } catch ( InterruptedException | IOException ex ) diff --git a/proxy/src/main/java/net/md_5/bungee/ListenThread.java b/proxy/src/main/java/net/md_5/bungee/ListenThread.java index 4ebef8fa3..d0e52973c 100644 --- a/proxy/src/main/java/net/md_5/bungee/ListenThread.java +++ b/proxy/src/main/java/net/md_5/bungee/ListenThread.java @@ -27,7 +27,7 @@ public class ListenThread extends Thread @Override public void run() { - while ( BungeeCord.getInstance().isRunning ) + while ( !isInterrupted() ) { try {