Skip to content

Commit

Permalink
fix: prevent unclosed client session / unclosed connector (#2618)
Browse files Browse the repository at this point in the history
Takes inspiration from Rapptz/discord.py#1967
Fixes #2399
  • Loading branch information
honzajavorek authored Oct 23, 2024
1 parent d101120 commit 1c9c5bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion discord/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@ async def close(self) -> None:
if self._closed:
return

await self.http.close()
self._closed = True

for voice in self.voice_clients:
Expand All @@ -726,7 +727,6 @@ async def close(self) -> None:
if self.ws is not None and self.ws.open:
await self.ws.close(code=1000)

await self.http.close()
self._ready.clear()

def clear(self) -> None:
Expand Down

0 comments on commit 1c9c5bb

Please sign in to comment.