v6.1.1
Patch Changes
-
#680
3fdd82fThanks @kkhys! - Disposing of a client event listener twice no longer removes an unrelated listenerThe unsubscribe function returned by
client.onspliced atindexOf(listener)without checking for-1, so removing an already-removed listener wouldsplice(-1, 1)and silently drop the most recently registered listener of the same event. This happens in practice without any double-dispose by the user: emits iterate over a copy of the listeners, so a one-shot internal listener that already unlistened itself during a nested emit (e.g. whenclient.terminate()is called from within aclosed/errorlistener) is re-invoked from the copy and unlistens again, knocking out registeredclosed/errorlisteners.