make sure to properly stop tagwriter
This commit is contained in:
parent
5dde977233
commit
b72d7ec8d0
|
@ -99,6 +99,13 @@ public class TagWriter {
|
|||
|
||||
public void forceClose() {
|
||||
finish();
|
||||
if (outputStream != null) {
|
||||
try {
|
||||
outputStream.close();
|
||||
} catch (IOException e) {
|
||||
//ignoring
|
||||
}
|
||||
}
|
||||
outputStream = null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ public class XmlReader {
|
|||
}
|
||||
|
||||
} catch (Throwable throwable) {
|
||||
throw new IOException("xml parser mishandled "+throwable.getClass().getName(), throwable);
|
||||
throw new IOException("xml parser mishandled "+throwable.getClass().getSimpleName()+"("+throwable.getMessage()+")", throwable);
|
||||
} finally {
|
||||
if (wakeLock.isHeld()) {
|
||||
try {
|
||||
|
|
|
@ -1356,6 +1356,9 @@ public class XmppConnection implements Runnable {
|
|||
}
|
||||
|
||||
private void forceCloseSocket() {
|
||||
if (tagWriter != null) {
|
||||
tagWriter.forceClose();
|
||||
}
|
||||
if (socket != null) {
|
||||
try {
|
||||
socket.close();
|
||||
|
@ -1375,7 +1378,6 @@ public class XmppConnection implements Runnable {
|
|||
interrupt();
|
||||
Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": disconnecting force="+Boolean.valueOf(force));
|
||||
if (force) {
|
||||
tagWriter.forceClose();
|
||||
forceCloseSocket();
|
||||
} else {
|
||||
if (tagWriter.isActive()) {
|
||||
|
|
Loading…
Reference in New Issue