diff options
author | Rechi <Rechi@users.noreply.github.com> | 2016-01-19 10:17:46 +0100 |
---|---|---|
committer | Martijn Kaijser <mcm.kaijser@gmail.com> | 2016-01-20 16:46:03 +0100 |
commit | a13cab21e2fdce87b8e8c82f6cfd86c5a56fb72f (patch) | |
tree | b3e16beaba52f629d0ff187b6d6dd5d65d76b817 | |
parent | fe24244d85de4a878b9887e9bbeb9f03518163d3 (diff) |
fix crashing if music is scanning and application gets stopped
-rw-r--r-- | xbmc/Application.cpp | 2 | ||||
-rw-r--r-- | xbmc/music/infoscanner/MusicInfoScanner.cpp | 4 | ||||
-rw-r--r-- | xbmc/music/infoscanner/MusicInfoScanner.h | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp index dcb16104df..0a55813a4f 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -2958,7 +2958,7 @@ void CApplication::Stop(int exitCode) // stop scanning before we kill the network and so on if (m_musicInfoScanner->IsScanning()) - m_musicInfoScanner->Stop(); + m_musicInfoScanner->Stop(true); if (CVideoLibraryQueue::GetInstance().IsRunning()) CVideoLibraryQueue::GetInstance().CancelAllJobs(); diff --git a/xbmc/music/infoscanner/MusicInfoScanner.cpp b/xbmc/music/infoscanner/MusicInfoScanner.cpp index 17b00f4bf2..43f9f82d36 100644 --- a/xbmc/music/infoscanner/MusicInfoScanner.cpp +++ b/xbmc/music/infoscanner/MusicInfoScanner.cpp @@ -393,12 +393,12 @@ bool CMusicInfoScanner::IsScanning() return m_bRunning; } -void CMusicInfoScanner::Stop() +void CMusicInfoScanner::Stop(bool wait /* = false*/) { if (m_bCanInterrupt) m_musicDatabase.Interupt(); - StopThread(false); + StopThread(wait); } void CMusicInfoScanner::CleanDatabase(bool showProgress /* = true */) diff --git a/xbmc/music/infoscanner/MusicInfoScanner.h b/xbmc/music/infoscanner/MusicInfoScanner.h index b26be2011b..655a2a749a 100644 --- a/xbmc/music/infoscanner/MusicInfoScanner.h +++ b/xbmc/music/infoscanner/MusicInfoScanner.h @@ -59,7 +59,7 @@ public: void FetchAlbumInfo(const std::string& strDirectory, bool refresh = false); void FetchArtistInfo(const std::string& strDirectory, bool refresh = false); bool IsScanning(); - void Stop(); + void Stop(bool wait = false); void CleanDatabase(bool showProgress = true); |