skip initial socket closing if thread was already interrupted

This commit is contained in:
Daniel Gultsch 2017-07-21 08:30:16 +02:00
parent 74cde1d60a
commit 2fc216bfc4
1 changed files with 7 additions and 1 deletions

View File

@ -495,7 +495,13 @@ public class XmppConnection implements Runnable {
@Override @Override
public void run() { 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(); connect();
} }