Skip to content

Commit

Permalink
Fix a race condition in getLocation()
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed Sep 25, 2023
1 parent 2ed4299 commit 50dc762
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/track/track.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ class Track : public QObject {

// Returns absolute path to the file, including the filename.
QString getLocation() const {
if (!m_fileAccess.info().hasLocation()) {
const auto fileInfo = getFileInfo();
if (!fileInfo.hasLocation()) {
return {};
}
return m_fileAccess.info().location();
return fileInfo.location();
}

/// Set the file type
Expand Down

0 comments on commit 50dc762

Please sign in to comment.