Unload pygame music file after use

This commit is contained in:
Keith Edmunds 2024-07-06 12:37:15 +01:00
parent f2867deb2f
commit dc3b46d2d6
2 changed files with 2 additions and 3 deletions

View File

@ -247,6 +247,7 @@ class PreviewManager:
def stop(self) -> None:
mixer.music.stop()
mixer.music.unload()
self.path = ""
self.row_number = None
self.track_id = 0

View File

@ -646,7 +646,7 @@ class PlaylistTab(QTableView):
def get_selected_row_track_info(self) -> Optional[TrackInfo]:
"""
Return the track_path, track_id and row number of the selected
Return the track_id and row number of the selected
row. If no row selected or selected row does not have a track,
return None.
"""
@ -679,8 +679,6 @@ class PlaylistTab(QTableView):
def get_selected_rows(self) -> List[int]:
"""Return a list of model-selected row numbers sorted by row"""
log.debug("get_selected_rows() called")
# Use a set to deduplicate result (a selected row will have all
# items in that row selected)
result = sorted(