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:
parent
8f0b8babc2
commit
aa937a704d
@ -382,8 +382,8 @@ class Session:
|
||||
await asyncio.wait_for(self.results[msg_id].event.wait(), timeout)
|
||||
except asyncio.TimeoutError:
|
||||
pass
|
||||
|
||||
result = self.results.pop(msg_id).value
|
||||
finally:
|
||||
result = self.results.pop(msg_id).value
|
||||
|
||||
if result is None:
|
||||
raise TimeoutError
|
||||
|
Loading…
Reference in New Issue
Block a user