mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-07-20 18:06:47 +00:00
Ensure after is called inside the daemon thread for players.
This commit is contained in:
parent
6166cbc2e7
commit
132ac45010
@ -118,9 +118,10 @@ class StreamPlayer(threading.Thread):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
self._current_error = e
|
self._current_error = e
|
||||||
self.stop()
|
self.stop()
|
||||||
|
finally:
|
||||||
|
self._call_after()
|
||||||
|
|
||||||
def stop(self):
|
def _call_after(self):
|
||||||
self._end.set()
|
|
||||||
if self.after is not None:
|
if self.after is not None:
|
||||||
try:
|
try:
|
||||||
arg_count = len(inspect.signature(self.after).parameters)
|
arg_count = len(inspect.signature(self.after).parameters)
|
||||||
@ -136,6 +137,9 @@ class StreamPlayer(threading.Thread):
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def stop(self):
|
||||||
|
self._end.set()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def error(self):
|
def error(self):
|
||||||
return self._current_error
|
return self._current_error
|
||||||
|
Loading…
x
Reference in New Issue
Block a user