fix:优化音乐停止功能,释放资源
- 在 stop_music 方法中添加 pygame.mixer.music.unload() 调用 - 该修改确保在停止音乐后卸载音乐文件,避免资源浪费
This commit is contained in:
@ -55,6 +55,7 @@ class MusicPlayer:
|
||||
|
||||
def stop_music(self):
|
||||
pygame.mixer.music.stop()
|
||||
pygame.mixer.music.unload()
|
||||
self.music_file = None
|
||||
self.finish = True
|
||||
self.pause = True
|
||||
|
Reference in New Issue
Block a user