Browse Source

Make sure the socket is closed when we call VoiceClient.disconnect

pull/245/merge
Rapptz 9 years ago
parent
commit
e736554777
  1. 8
      discord/voice_client.py

8
discord/voice_client.py

@ -253,10 +253,12 @@ class VoiceClient:
if not self._connected.is_set(): if not self._connected.is_set():
return return
self.socket.close()
self._connected.clear() self._connected.clear()
yield from self.ws.close() try:
yield from self.main_ws.voice_state(self.guild_id, None, self_mute=True) yield from self.ws.close()
yield from self.main_ws.voice_state(self.guild_id, None, self_mute=True)
finally:
self.socket.close()
@asyncio.coroutine @asyncio.coroutine
def move_to(self, channel): def move_to(self, channel):

Loading…
Cancel
Save