From 7cc6f198cf437ae60185b65bfa556341be8ec63f Mon Sep 17 00:00:00 2001 From: ailurux Date: Fri, 4 Oct 2024 14:41:05 +1000 Subject: Explicitly close the playlist files in the queue on storage unmount --- src/tangara/audio/track_queue.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/tangara/audio/track_queue.cpp') diff --git a/src/tangara/audio/track_queue.cpp b/src/tangara/audio/track_queue.cpp index 35c1403f..05ac0b95 100644 --- a/src/tangara/audio/track_queue.cpp +++ b/src/tangara/audio/track_queue.cpp @@ -159,6 +159,13 @@ auto TrackQueue::open() -> bool { return playlist_.open(); } +auto TrackQueue::close() -> void { + playlist_.close(); + if (opened_playlist_) { + opened_playlist_->close(); + } +} + auto TrackQueue::openPlaylist(const std::string& playlist_file, bool notify) -> bool { opened_playlist_.emplace(playlist_file); -- cgit v1.2.3