1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2024-11-22 00:42:16 -05:00

PircBot: Gracefully handle disposing of the PircBot before I/O threads are started

This commit is contained in:
Steven Luo 2011-06-29 01:18:39 -07:00 committed by Sebastian Kaspari
parent ae871f8a1f
commit a69fafc4dd

View File

@ -2983,8 +2983,12 @@ public abstract class PircBot implements ReplyConstants {
*/
public synchronized void dispose() {
//System.out.println("disposing...");
_outputThread.interrupt();
_inputThread.dispose();
if (_outputThread != null) {
_outputThread.interrupt();
}
if (_inputThread != null) {
_inputThread.dispose();
}
}