mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-10 18:59:41 +02:00
Cancel opened collectors. SMACK-145
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2344 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
2b41ad0ccf
commit
d53f0e9492
5 changed files with 39 additions and 0 deletions
|
@ -188,6 +188,7 @@ public class GroupChat {
|
|||
connection.sendPacket(joinPresence);
|
||||
// Wait up to a certain number of seconds for a reply.
|
||||
Presence presence = (Presence)response.nextResult(timeout);
|
||||
response.cancel();
|
||||
if (presence == null) {
|
||||
throw new XMPPException("No response from server.");
|
||||
}
|
||||
|
@ -364,4 +365,14 @@ public class GroupChat {
|
|||
public void addMessageListener(PacketListener listener) {
|
||||
connection.addPacketListener(listener, messageFilter);
|
||||
}
|
||||
|
||||
public void finalize() throws Throwable {
|
||||
super.finalize();
|
||||
try {
|
||||
if (messageCollector != null) {
|
||||
messageCollector.cancel();
|
||||
}
|
||||
}
|
||||
catch (Exception e) {}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue