Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

changed: get rid of old EXE section cruft

  • Loading branch information...
commit d66af942eb5c401e575024a3c51d55ddfd0392b3 1 parent 4505d08
spiff authored
2  xbmc/ApplicationMessenger.cpp
View
@@ -26,7 +26,6 @@
#include "guilib/TextureManager.h"
#include "PlayListPlayer.h"
#include "Util.h"
-#include "SectionLoader.h"
#ifdef HAS_PYTHON
#include "interfaces/python/XBPython.h"
#endif
@@ -516,7 +515,6 @@ case TMSG_POWERDOWN:
#ifdef HAS_HTTPAPI
if (!m_pXbmcHttp)
{
- CSectionLoader::Load("LIBHTTP");
m_pXbmcHttp = new CXbmcHttp();
}
switch (m_pXbmcHttp->xbmcCommand(pMsg->strParam))
104 xbmc/SectionLoader.cpp
View
@@ -45,81 +45,6 @@ CSectionLoader::~CSectionLoader(void)
UnloadAll();
}
-bool CSectionLoader::IsLoaded(const CStdString& strSection)
-{
- CSingleLock lock(g_sectionLoader.m_critSection);
-
- for (int i = 0; i < (int)g_sectionLoader.m_vecLoadedSections.size(); ++i)
- {
- CSection& section = g_sectionLoader.m_vecLoadedSections[i];
- if (section.m_strSectionName == strSection && section.m_lReferenceCount > 0) return true;
- }
- return false;
-}
-
-bool CSectionLoader::Load(const CStdString& strSection)
-{
- CSingleLock lock(g_sectionLoader.m_critSection);
-
- for (int i = 0; i < (int)g_sectionLoader.m_vecLoadedSections.size(); ++i)
- {
- CSection& section = g_sectionLoader.m_vecLoadedSections[i];
- if (section.m_strSectionName == strSection)
- {
-
-#ifdef LOGALL
- CLog::Log(LOGDEBUG,"SECTION:LoadSection(%s) count:%i\n", strSection.c_str(), section.m_lReferenceCount);
-#endif
-
- section.m_lReferenceCount++;
- return true;
- }
- }
-
-#ifdef HAS_SECTIONS
- if ( NULL == XLoadSection(strSection.c_str() ) )
- {
- CLog::Log(LOGDEBUG,"SECTION:LoadSection(%s) load failed!!\n", strSection.c_str());
- return false;
- }
- HANDLE hHandle = XGetSectionHandle(strSection.c_str());
-
- CLog::Log(LOGDEBUG,"SECTION:Section %s loaded count:1 size:%i\n", strSection.c_str(), XGetSectionSize(hHandle) );
-#endif
-
- CSection newSection;
- newSection.m_strSectionName = strSection;
- newSection.m_lReferenceCount = 1;
- g_sectionLoader.m_vecLoadedSections.push_back(newSection);
- return true;
-}
-
-void CSectionLoader::Unload(const CStdString& strSection)
-{
- CSingleLock lock(g_sectionLoader.m_critSection);
- if (!CSectionLoader::IsLoaded(strSection)) return ;
-
- ivecLoadedSections i;
- i = g_sectionLoader.m_vecLoadedSections.begin();
- while (i != g_sectionLoader.m_vecLoadedSections.end())
- {
- CSection& section = *i;
- if (section.m_strSectionName == strSection)
- {
-#ifdef LOGALL
- CLog::Log(LOGDEBUG,"SECTION:FreeSection(%s) count:%i\n", strSection.c_str(), section.m_lReferenceCount);
-#endif
- section.m_lReferenceCount--;
- if ( 0 == section.m_lReferenceCount)
- {
- section.m_unloadDelayStartTick = XbmcThreads::SystemClockMillis();
- return ;
- }
- }
- ++i;
- }
-}
-
LibraryLoader *CSectionLoader::LoadDLL(const CStdString &dllname, bool bDelayUnload /*=true*/, bool bLoadSymbols /*=false*/)
{
CSingleLock lock(g_sectionLoader.m_critSection);
@@ -186,22 +111,6 @@ void CSectionLoader::UnloadDelayed()
{
CSingleLock lock(g_sectionLoader.m_critSection);
- ivecLoadedSections i = g_sectionLoader.m_vecLoadedSections.begin();
- while( i != g_sectionLoader.m_vecLoadedSections.end() )
- {
- CSection& section = *i;
- if( section.m_lReferenceCount == 0 && XbmcThreads::SystemClockMillis() - section.m_unloadDelayStartTick > UNLOAD_DELAY)
- {
- CLog::Log(LOGDEBUG,"SECTION:UnloadDelayed(SECTION: %s)", section.m_strSectionName.c_str());
-#ifdef HAS_SECTIONS
- XFreeSection(section.m_strSectionName.c_str());
-#endif
- i = g_sectionLoader.m_vecLoadedSections.erase(i);
- continue;
- }
- i++;
- }
-
// check if we can unload any unreferenced dlls
for (int i = 0; i < (int)g_sectionLoader.m_vecLoadedDLLs.size(); ++i)
{
@@ -220,19 +129,6 @@ void CSectionLoader::UnloadDelayed()
void CSectionLoader::UnloadAll()
{
- ivecLoadedSections i;
- i = g_sectionLoader.m_vecLoadedSections.begin();
- while (i != g_sectionLoader.m_vecLoadedSections.end())
- {
- CSection& section = *i;
- //g_sectionLoader.m_vecLoadedSections.erase(i);
- CLog::Log(LOGDEBUG,"SECTION:UnloadAll(SECTION: %s)", section.m_strSectionName.c_str());
-#ifdef HAS_SECTIONS
- XFreeSection(section.m_strSectionName.c_str());
-#endif
- i = g_sectionLoader.m_vecLoadedSections.erase(i);
- }
-
// delete the dll's
CSingleLock lock(g_sectionLoader.m_critSection);
vector<CDll>::iterator it = g_sectionLoader.m_vecLoadedDLLs.begin();
12 xbmc/SectionLoader.h
View
@@ -30,13 +30,6 @@ class LibraryLoader;
class CSectionLoader
{
public:
- class CSection
- {
- public:
- CStdString m_strSectionName;
- long m_lReferenceCount;
- unsigned int m_unloadDelayStartTick;
- };
class CDll
{
public:
@@ -49,15 +42,10 @@ class CSectionLoader
CSectionLoader(void);
virtual ~CSectionLoader(void);
- static bool IsLoaded(const CStdString& strSection);
- static bool Load(const CStdString& strSection);
- static void Unload(const CStdString& strSection);
static LibraryLoader* LoadDLL(const CStdString& strSection, bool bDelayUnload=true, bool bLoadSymbols=false);
static void UnloadDLL(const CStdString& strSection);
static void UnloadDelayed();
protected:
- std::vector<CSection> m_vecLoadedSections;
- typedef std::vector<CSection>::iterator ivecLoadedSections;
std::vector<CDll> m_vecLoadedDLLs;
CCriticalSection m_critSection;
3  xbmc/filesystem/DAAPDirectory.cpp
View
@@ -22,7 +22,6 @@
#include "DAAPDirectory.h"
#include "music/tags/MusicInfoTag.h"
#include "FileItem.h"
-#include "SectionLoader.h"
#include "utils/log.h"
#include "utils/URIUtils.h"
@@ -37,7 +36,6 @@ const char unknownArtistAlbum[] = "Unknown";
CDAAPDirectory::CDAAPDirectory(void)
{
- CSectionLoader::Load("LIBXDAAP");
// m_currLevel holds where we are in the playlist/artist/album/songs hierarchy (0,1,2,3)
m_currLevel = -1;
m_thisHost = NULL;
@@ -55,7 +53,6 @@ CDAAPDirectory::~CDAAPDirectory(void)
m_artisthead = NULL;
m_currentSongItems = NULL;
- CSectionLoader::Unload("LIBXDAAP");
}
bool CDAAPDirectory::GetDirectory(const CStdString& strPath, CFileItemList &items)
3  xbmc/filesystem/DAAPFile.cpp
View
@@ -19,7 +19,6 @@
*/
#include "DAAPFile.h"
-#include "SectionLoader.h"
#include "threads/SingleLock.h"
#include "utils/log.h"
#include <sys/stat.h>
@@ -79,8 +78,6 @@ void CDaapClient::Release()
DAAP_SClientHost* CDaapClient::GetHost(const CStdString &strHost)
{
- //We need this section from now on
- if( !CSectionLoader::IsLoaded("LIBXDAAP") ) CSectionLoader::Load("LIBXDAAP");
try
{
3  xbmc/filesystem/RTVDirectory.cpp
View
@@ -25,7 +25,6 @@
#include "RTVDirectory.h"
#include "utils/URIUtils.h"
-#include "SectionLoader.h"
#include "URL.h"
#include "tinyXML/tinyxml.h"
#include "FileItem.h"
@@ -43,12 +42,10 @@ extern "C"
CRTVDirectory::CRTVDirectory(void)
{
- CSectionLoader::Load("LIBRTV");
}
CRTVDirectory::~CRTVDirectory(void)
{
- CSectionLoader::Unload("LIBRTV");
}
//*********************************************************************************************
3  xbmc/filesystem/RTVFile.cpp
View
@@ -24,7 +24,6 @@
//////////////////////////////////////////////////////////////////////
#include "RTVFile.h"
-#include "SectionLoader.h"
#include "URL.h"
#include "utils/log.h"
#include <errno.h>
@@ -46,7 +45,6 @@ using namespace XFILE;
CRTVFile::CRTVFile()
{
- CSectionLoader::Load("LIBRTV");
m_filePos = 0;
m_fileSize = 0;
m_bOpened = false;
@@ -56,7 +54,6 @@ CRTVFile::CRTVFile()
CRTVFile::~CRTVFile()
{
Close();
- CSectionLoader::Unload("LIBRTV");
}
//*********************************************************************************************
7 xbmc/utils/LangCodeExpander.cpp
View
@@ -20,7 +20,6 @@
*/
#include "LangCodeExpander.h"
-#include "SectionLoader.h"
#include "tinyXML/tinyxml.h"
#include "utils/log.h"
@@ -223,33 +222,27 @@ bool CLangCodeExpander::LookupInDb(CStdString& desc, const CStdString& code)
sCode.TrimRight();
if(sCode.length() == 2)
{
- CSectionLoader::Load("LCODE");
longcode = MAKECODE('\0', '\0', sCode[0], sCode[1]);
for(unsigned int i = 0; i < sizeof(g_iso639_1) / sizeof(LCENTRY); i++)
{
if(g_iso639_1[i].code == longcode)
{
desc = g_iso639_1[i].name;
- CSectionLoader::Unload("LCODE");
return true;
}
}
- CSectionLoader::Unload("LCODE");
}
else if(code.length() == 3)
{
- CSectionLoader::Load("LCODE");
longcode = MAKECODE('\0', sCode[0], sCode[1], sCode[2]);
for(unsigned int i = 0; i < sizeof(g_iso639_2) / sizeof(LCENTRY); i++)
{
if(g_iso639_2[i].code == longcode)
{
desc = g_iso639_2[i].name;
- CSectionLoader::Unload("LCODE");
return true;
}
}
- CSectionLoader::Unload("LCODE");
}
return false;
}
Please sign in to comment.
Something went wrong with that request. Please try again.