Close the ClientSession in __del__.
This commit is contained in:
parent
d3fac94e21
commit
7834236044
@ -125,6 +125,10 @@ class Client:
|
|||||||
self._voice_data_found = asyncio.Event(loop=self.loop)
|
self._voice_data_found = asyncio.Event(loop=self.loop)
|
||||||
self._session_id_found = asyncio.Event(loop=self.loop)
|
self._session_id_found = asyncio.Event(loop=self.loop)
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
if hasattr(self, 'session'):
|
||||||
|
self.session.close()
|
||||||
|
|
||||||
# internals
|
# internals
|
||||||
|
|
||||||
def handle_message(self, message):
|
def handle_message(self, message):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user