From 0839a853a8e62a216ae09a69efaf8e2e32b95329 Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Sun, 25 Oct 2020 19:34:54 +0100 Subject: [PATCH] fix client removal from path in case of errors during setup --- client/client.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/client/client.go b/client/client.go index 9d8f551f..f72f1745 100644 --- a/client/client.go +++ b/client/client.go @@ -210,6 +210,11 @@ func (c *Client) run() { } } + if c.path != nil { + c.path.OnClientRemove(c) + c.path = nil + } + if onConnectCmd != nil { onConnectCmd.Close() } @@ -901,9 +906,6 @@ func (c *Client) runWaitingDescribe() bool { } }() - c.path.OnClientRemove(c) - c.path = nil - c.conn.Close() return false } @@ -939,9 +941,6 @@ func (c *Client) runPlay() bool { onReadCmd.Close() } - c.path.OnClientRemove(c) - c.path = nil - return false } @@ -1126,9 +1125,6 @@ func (c *Client) runRecord() bool { } } - c.path.OnClientRemove(c) - c.path = nil - return false }