kill music dl thread and clear player list on disconnect

This commit is contained in:
cidoku 2025-02-14 16:21:07 -03:00
parent ed6a6cc3b2
commit 8d88b150a9

View File

@ -2541,6 +2541,12 @@ class gui(QtGui.QWidget):
if audio.handleisactive(self.music): if audio.handleisactive(self.music):
audio.stophandle(self.music) audio.stophandle(self.music)
audio.freehandle(self.music) audio.freehandle(self.music)
if self.stream:
del self.stream
if self.download_thread:
self.download_thread.terminate() # Live dangerously
self.download_thread = None
def playDownloadedMusic(self, file_length): def playDownloadedMusic(self, file_length):
# Part of the evil HTTPS music download hack for XP systems # Part of the evil HTTPS music download hack for XP systems
@ -2947,6 +2953,7 @@ class TCP_Thread(QtCore.QThread):
color.setHsv(rainbow, 255, 255) color.setHsv(rainbow, 255, 255)
while True: while True:
if self.parent.disconnectnow: if self.parent.disconnectnow:
self.parent.playerList.clear()
self.parent.stopMusic() self.parent.stopMusic()
self.parent.tcp.close() self.parent.tcp.close()
self.quit() self.quit()