From f7ccbe14217e29bd1bf0689f094355305b80bb4e Mon Sep 17 00:00:00 2001 From: Gaston Dombiak Date: Fri, 16 Jul 2004 21:00:07 +0000 Subject: [PATCH] Makes finalize more secure. git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2345 b35dd754-fafc-0310-a699-88a17e54d16e --- .../jivesoftware/smackx/muc/MultiUserChat.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/source/org/jivesoftware/smackx/muc/MultiUserChat.java b/source/org/jivesoftware/smackx/muc/MultiUserChat.java index 8d9e52a42..9cbdee30e 100644 --- a/source/org/jivesoftware/smackx/muc/MultiUserChat.java +++ b/source/org/jivesoftware/smackx/muc/MultiUserChat.java @@ -2118,13 +2118,17 @@ public class MultiUserChat { } } - public void finalize() { - if (connection != null) { - messageCollector.cancel(); - connection.removePacketListener(subjectListener); - connection.removePacketListener(presenceListener); - connection.removePacketListener(declinesListener); + public void finalize() throws Throwable { + super.finalize(); + try { + if (connection != null) { + messageCollector.cancel(); + connection.removePacketListener(subjectListener); + connection.removePacketListener(presenceListener); + connection.removePacketListener(declinesListener); + } } + catch (Exception e) {} } /**