1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-23 13:07:59 +01:00

Makes finalize more secure.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2345 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Gaston Dombiak 2004-07-16 21:00:07 +00:00 committed by gdombiak
parent d53f0e9492
commit f7ccbe1421

View file

@ -2118,13 +2118,17 @@ public class MultiUserChat {
} }
} }
public void finalize() { public void finalize() throws Throwable {
if (connection != null) { super.finalize();
messageCollector.cancel(); try {
connection.removePacketListener(subjectListener); if (connection != null) {
connection.removePacketListener(presenceListener); messageCollector.cancel();
connection.removePacketListener(declinesListener); connection.removePacketListener(subjectListener);
connection.removePacketListener(presenceListener);
connection.removePacketListener(declinesListener);
}
} }
catch (Exception e) {}
} }
/** /**