From a13cab21e2fdce87b8e8c82f6cfd86c5a56fb72f Mon Sep 17 00:00:00 2001 From: Rechi Date: Tue, 19 Jan 2016 10:17:46 +0100 Subject: fix crashing if music is scanning and application gets stopped --- xbmc/Application.cpp | 2 +- xbmc/music/infoscanner/MusicInfoScanner.cpp | 4 ++-- 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); -- cgit v1.2.3