add Stop() to Client

This commit is contained in:
Aleksandr Zelenin 2018-10-24 17:58:48 +03:00
parent ef52e705ae
commit 0eea5d02de

View file

@ -67,6 +67,8 @@ func NewClient(authorizationStateHandler AuthorizationStateHandler, options ...O
err := Authorize(client, authorizationStateHandler) err := Authorize(client, authorizationStateHandler)
if err != nil { if err != nil {
client.Stop()
return nil, err return nil, err
} }
@ -143,3 +145,8 @@ func (client *Client) GetListener() *Listener {
return listener return listener
} }
func (client *Client) Stop() {
client.Destroy()
client.jsonClient.Destroy()
}