mirror of
https://github.com/pyrogram/pyrogram
synced 2025-09-01 23:05:15 +00:00
fixed memory leak when session.send coroutine is cancelled (#311)
added that when session.send coroutine is cancelled (or if any other exception is raised) the result should still be removed from the results list
This commit is contained in:
@@ -382,7 +382,7 @@ class Session:
|
|||||||
await asyncio.wait_for(self.results[msg_id].event.wait(), timeout)
|
await asyncio.wait_for(self.results[msg_id].event.wait(), timeout)
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
pass
|
pass
|
||||||
|
finally:
|
||||||
result = self.results.pop(msg_id).value
|
result = self.results.pop(msg_id).value
|
||||||
|
|
||||||
if result is None:
|
if result is None:
|
||||||
|
Reference in New Issue
Block a user