mirror of
https://github.com/c0re100/gotdlib.git
synced 2026-02-21 20:20:17 +01:00
add Stop() to Client
This commit is contained in:
parent
ef52e705ae
commit
0eea5d02de
1 changed files with 7 additions and 0 deletions
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue