fix(llc): channel clean up after dispose from cache (#1342)

* fix: channel clean up after dispose from cache

* chore(llc): update changelog

* fix(llc): refactor setter in add/remove methods

* fix tests

Co-authored-by: Salvatore Giordano <[email protected]>
This commit is contained in:
Daniel
2022-10-10 12:59:35 +02:00
committed by GitHub
co-authored by Salvatore Giordano
parent 25bc504125
commit 37e01b118b
5 changed files with 39 additions and 8 deletions
@@ -1237,7 +1237,7 @@ class Channel {
state = ChannelClientState(this, channelState);
if (cid != null) {
client.state.channels = {cid!: this};
client.state.addChannels({cid!: this});
}
if (!_initializedCompleter.isCompleted) {
_initializedCompleter.complete(true);
@@ -1544,6 +1544,7 @@ class Channel {
/// Call this method to dispose the channel client.
void dispose() {
client.state.removeChannel('$cid');
state?.dispose();
_keyStrokeHandler.cancel();
}