There is no way to reliably end a Chat and have a new one created.
Description
If a Chat "thrown away" (i.e. unreferenced) by a user, the ChatManager still maintains a weak reference to the Chat object. This means if new messages come in from the same user, they will still get delivered to that Chat, even though there are likely no more listeners registered to process the messages.
The user will have no knowledge that new messages came in, since the ChatManager will not create a new Chat since one already exists. The ChatManager will maintain a reference to that until it is GC'ed, thus making it very upredictable. Once GC'ed, the manager will now create a new Chat.
The Chat should have a close method to effectively shut it down and remove it from the manager so the behaviour will be consistent and predictable.
If a Chat "thrown away" (i.e. unreferenced) by a user, the ChatManager still maintains a weak reference to the Chat object. This means if new messages come in from the same user, they will still get delivered to that Chat, even though there are likely no more listeners registered to process the messages.
The user will have no knowledge that new messages came in, since the ChatManager will not create a new Chat since one already exists. The ChatManager will maintain a reference to that until it is GC'ed, thus making it very upredictable. Once GC'ed, the manager will now create a new Chat.
The Chat should have a close method to effectively shut it down and remove it from the manager so the behaviour will be consistent and predictable.