Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #2420 from Montellese/rssmanager_locks

fix possible access violation in CRssManager::Clear() during shutdown
  • Loading branch information...
commit 482797ff7284b63f8c0ba2e0500ad709340a677c 2 parents 3d13a60 + a9cf850
@Montellese Montellese authored
View
4 xbmc/settings/Settings.cpp
@@ -141,9 +141,7 @@ void CSettings::Initialize()
}
CSettings::~CSettings(void)
-{
- Clear();
-}
+{ }
void CSettings::Save() const
View
6 xbmc/utils/RssManager.cpp
@@ -21,6 +21,7 @@
#include "RssManager.h"
#include "filesystem/File.h"
#include "settings/Settings.h"
+#include "threads/SingleLock.h"
#include "utils/log.h"
#include "utils/RssReader.h"
#include "utils/StringUtils.h"
@@ -36,7 +37,6 @@ CRssManager::CRssManager()
CRssManager::~CRssManager()
{
Stop();
- Clear();
}
CRssManager& CRssManager::Get()
@@ -52,6 +52,7 @@ void CRssManager::Start()
void CRssManager::Stop()
{
+ CSingleLock lock(m_critical);
m_bActive = false;
for (unsigned int i = 0; i < m_readers.size(); i++)
{
@@ -63,6 +64,7 @@ void CRssManager::Stop()
bool CRssManager::Load()
{
+ CSingleLock lock(m_critical);
string rssXML = g_settings.GetUserDataItem("RssFeeds.xml");
if (!CFile::Exists(rssXML))
return false;
@@ -134,12 +136,14 @@ bool CRssManager::Reload()
void CRssManager::Clear()
{
+ CSingleLock lock(m_critical);
m_mapRssUrls.clear();
}
// returns true if the reader doesn't need creating, false otherwise
bool CRssManager::GetReader(int controlID, int windowID, IRssObserver* observer, CRssReader *&reader)
{
+ CSingleLock lock(m_critical);
// check to see if we've already created this reader
for (unsigned int i = 0; i < m_readers.size(); i++)
{
View
3  xbmc/utils/RssManager.h
@@ -23,6 +23,8 @@
#include <vector>
#include <string>
+#include "threads/CriticalSection.h"
+
class CRssReader;
class IRssObserver;
@@ -66,4 +68,5 @@ class CRssManager
std::vector<READERCONTROL> m_readers;
RssUrls m_mapRssUrls;
bool m_bActive;
+ CCriticalSection m_critical;
};
Please sign in to comment.
Something went wrong with that request. Please try again.