summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTarun Gupta <tarun1995gupta@gmail.com>2015-07-26 07:47:40 (GMT)
committerTarun Gupta <tarun1995gupta@gmail.com>2015-08-17 13:21:01 (GMT)
commitf56f245c1f7e768caf356a0e7b57f428cf8cc6da (patch)
treef0935ab00c73e86163abe72fc9c20098121fff4f /src/com/isode/stroke/client/ClientSessionStanzaChannel.java
parent2533374644704040ca67aba4e1240a9d6ea450c8 (diff)
downloadstroke-f56f245c1f7e768caf356a0e7b57f428cf8cc6da.zip
stroke-f56f245c1f7e768caf356a0e7b57f428cf8cc6da.tar.bz2
Update Client.
Updates all bits of Client to be in parity with Swiften. Some part of code which depends on Network is commented. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Tests added for: ClientBlockListManager, ClientSession and NickResolver. All tests pass. Change-Id: I5b9b0e5ae5b2df58202e2349ba24e4544d9a4614
Diffstat (limited to 'src/com/isode/stroke/client/ClientSessionStanzaChannel.java')
-rw-r--r--src/com/isode/stroke/client/ClientSessionStanzaChannel.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/com/isode/stroke/client/ClientSessionStanzaChannel.java b/src/com/isode/stroke/client/ClientSessionStanzaChannel.java
index 0aa024f..e8275a0 100644
--- a/src/com/isode/stroke/client/ClientSessionStanzaChannel.java
+++ b/src/com/isode/stroke/client/ClientSessionStanzaChannel.java
@@ -9,6 +9,7 @@
package com.isode.stroke.client;
import com.isode.stroke.base.Error;
+import com.isode.stroke.base.IDGenerator;
import com.isode.stroke.elements.IQ;
import com.isode.stroke.elements.Message;
import com.isode.stroke.elements.Presence;
@@ -26,7 +27,7 @@ import java.util.logging.Logger;
* StanzaChannel implementation around a ClientSession.
*/
public class ClientSessionStanzaChannel extends StanzaChannel {
- private final IDGenerator idGenerator = new IDGenerator();
+ private IDGenerator idGenerator = new IDGenerator();
private ClientSession session;
private static final Logger logger_ = Logger.getLogger(ClientSessionStanzaChannel.class.getName());
private SignalConnection sessionInitializedConnection;
@@ -34,6 +35,21 @@ public class ClientSessionStanzaChannel extends StanzaChannel {
private SignalConnection sessionStanzaReceivedConnection;
private SignalConnection sessionStanzaAckedConnection;
+ protected void finalize() throws Throwable {
+ try {
+ if(session != null) {
+ sessionFinishedConnection.disconnect();
+ sessionStanzaReceivedConnection.disconnect();
+ sessionStanzaAckedConnection.disconnect();
+ sessionInitializedConnection.disconnect();
+ session = null;
+ }
+ }
+ finally {
+ super.finalize();
+ }
+ }
+
public void setSession(final ClientSession session) {
assert this.session == null;
this.session = session;