diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index 0d0e6428..22334bc5 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -495,7 +495,13 @@ public class XmppConnection implements Runnable { @Override public void run() { - forceCloseSocket(); + synchronized (this) { + if (Thread.currentThread().isInterrupted()) { + Log.d(Config.LOGTAG,account.getJid().toBareJid()+": aborting connect because thread was interrupted"); + return; + } + forceCloseSocket(); + } connect(); }