mirror of
https://github.com/sochix/TLSharp.git
synced 2025-12-06 08:02:00 +01:00
Implementing IDisposable
This commit is contained in:
parent
ca6e18b50e
commit
fc09dba71b
|
|
@ -21,7 +21,7 @@ using TLAuthorization = TeleSharp.TL.Auth.TLAuthorization;
|
||||||
|
|
||||||
namespace TLSharp.Core
|
namespace TLSharp.Core
|
||||||
{
|
{
|
||||||
public class TelegramClient
|
public class TelegramClient : IDisposable
|
||||||
{
|
{
|
||||||
private MtProtoSender _sender;
|
private MtProtoSender _sender;
|
||||||
private AuthKey _key;
|
private AuthKey _key;
|
||||||
|
|
@ -333,6 +333,15 @@ namespace TLSharp.Core
|
||||||
|
|
||||||
_session.Save();
|
_session.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
if (_transport != null)
|
||||||
|
{
|
||||||
|
_transport.Dispose();
|
||||||
|
_transport = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class MissingApiConfigurationException : Exception
|
public class MissingApiConfigurationException : Exception
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue