Merge pull request #4775 from jmarshallnz/empty_episode_playcount
[vuplus_xbmc] / xbmc / BackgroundInfoLoader.cpp
index 8e488d0..3466800 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *      Copyright (C) 2005-2013 Team XBMC
- *      http://www.xbmc.org
+ *      http://xbmc.org
  *
  *  This Program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -32,6 +32,7 @@ CBackgroundInfoLoader::CBackgroundInfoLoader() : m_thread (NULL)
   m_pObserver=NULL;
   m_pProgressCallback=NULL;
   m_pVecItems = NULL;
+  m_bIsLoading = false;
 }
 
 CBackgroundInfoLoader::~CBackgroundInfoLoader()
@@ -89,9 +90,11 @@ void CBackgroundInfoLoader::Run()
     }
 
     OnLoaderFinish();
+    m_bIsLoading = false;
   }
   catch (...)
   {
+    m_bIsLoading = false;
     CLog::Log(LOGERROR, "%s - Unhandled exception", __FUNCTION__);
   }
 }
@@ -110,6 +113,7 @@ void CBackgroundInfoLoader::Load(CFileItemList& items)
 
   m_pVecItems = &items;
   m_bStop = false;
+  m_bIsLoading = true;
 
   m_thread = new CThread(this, "BackgroundLoader");
   m_thread->Create();
@@ -136,11 +140,12 @@ void CBackgroundInfoLoader::StopThread()
   }
   m_vecItems.clear();
   m_pVecItems = NULL;
+  m_bIsLoading = false;
 }
 
 bool CBackgroundInfoLoader::IsLoading()
 {
-  return m_thread != NULL;
+  return m_bIsLoading;
 }
 
 void CBackgroundInfoLoader::SetObserver(IBackgroundLoaderObserver* pObserver)