aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRechi <Rechi@users.noreply.github.com>2016-01-19 10:17:46 +0100
committerMartijn Kaijser <mcm.kaijser@gmail.com>2016-01-20 16:46:03 +0100
commita13cab21e2fdce87b8e8c82f6cfd86c5a56fb72f (patch)
treeb3e16beaba52f629d0ff187b6d6dd5d65d76b817
parentfe24244d85de4a878b9887e9bbeb9f03518163d3 (diff)
fix crashing if music is scanning and application gets stopped
-rw-r--r--xbmc/Application.cpp2
-rw-r--r--xbmc/music/infoscanner/MusicInfoScanner.cpp4
-rw-r--r--xbmc/music/infoscanner/MusicInfoScanner.h2
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);