After opening an XMPP Chat using the Smack library, is it necessary (or even possible) to explicitly close a Chat?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You simply drop your own references to it, and it will eventually disappear on it’s own. It is only held by weak references inside the ChatManager so it will get GC’ed eventually.
You should probably remove your listeners as well though, if you don’t want to receive any more chat messages while the Chat class is waiting to be GC’ed.