From 0eea5d02def1e52535ddca87e7a4882d70de4a0b Mon Sep 17 00:00:00 2001 From: Aleksandr Zelenin Date: Wed, 24 Oct 2018 17:58:48 +0300 Subject: [PATCH] add Stop() to Client --- client/client.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/client.go b/client/client.go index c4f8d6e..1b24931 100644 --- a/client/client.go +++ b/client/client.go @@ -67,6 +67,8 @@ func NewClient(authorizationStateHandler AuthorizationStateHandler, options ...O err := Authorize(client, authorizationStateHandler) if err != nil { + client.Stop() + return nil, err } @@ -143,3 +145,8 @@ func (client *Client) GetListener() *Listener { return listener } + +func (client *Client) Stop() { + client.Destroy() + client.jsonClient.Destroy() +}