diff --git a/source/org/jivesoftware/smack/XMPPConnection.java b/source/org/jivesoftware/smack/XMPPConnection.java index caa3d3ede..e3136413f 100644 --- a/source/org/jivesoftware/smack/XMPPConnection.java +++ b/source/org/jivesoftware/smack/XMPPConnection.java @@ -562,6 +562,11 @@ public class XMPPConnection { protected void shutdown(Presence unavailablePresence) { // Set presence to offline. packetWriter.sendPacket(unavailablePresence); + + this.setWasAuthenticated(authenticated); + authenticated = false; + connected = false; + packetReader.shutdown(); packetWriter.shutdown(); // Wait 150 ms for processes to clean-up, then shutdown. @@ -591,10 +596,6 @@ public class XMPPConnection { // Ignore. } - this.setWasAuthenticated(authenticated); - authenticated = false; - connected = false; - saslAuthentication.init(); }