From 6e0976c27ec5d095212d4e25e5364ed2202e3402 Mon Sep 17 00:00:00 2001 From: Alexa Wolfe Date: Fri, 5 Aug 2016 23:56:39 +0200 Subject: [PATCH] Remove Locator reliance on obsolete .ini fields --- Locator/MLocator.cpp | 4 ++-- Locator/MLocator.h | 4 ++-- Locator/MLocatorConfig.cpp | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Locator/MLocator.cpp b/Locator/MLocator.cpp index ebb89bdd..40f7d681 100644 --- a/Locator/MLocator.cpp +++ b/Locator/MLocator.cpp @@ -265,9 +265,9 @@ bool MLocator::InitCountryCodeFilter() void MLocator::Destroy() { - // MCommandCommunicator::Destroy(); - +#ifdef LOCATOR_FREESTANDING ReleaseDBMgr(); +#endif ReleaseSafeUDP(); ReleaseUDPManager(); ReleaseValidCountryCodeList(); diff --git a/Locator/MLocator.h b/Locator/MLocator.h index e1511f03..04ba2a6f 100644 --- a/Locator/MLocator.h +++ b/Locator/MLocator.h @@ -160,8 +160,8 @@ private : DWORD m_nSendCount; DWORD m_nDuplicatedCount; - MLocatorDBMgr* m_pDBMgr; - MCountryFilter* m_pCountryFilter; + MLocatorDBMgr* m_pDBMgr = nullptr; + MCountryFilter* m_pCountryFilter = nullptr; void* m_vpServerStatusInfoBlob; int m_nLastGetServerStatusCount; diff --git a/Locator/MLocatorConfig.cpp b/Locator/MLocatorConfig.cpp index 1cbea2fd..215fd9ff 100644 --- a/Locator/MLocatorConfig.cpp +++ b/Locator/MLocatorConfig.cpp @@ -24,7 +24,9 @@ MLocatorConfig::~MLocatorConfig(void) bool MLocatorConfig::LoadConfig() { +#ifdef LOCATOR_FREESTANDING if( !LoadDBConfig() ) return false; +#endif if( !LoadNetConfig() ) return false; if( !LoadEnvConfig() ) return false; @@ -55,9 +57,11 @@ bool MLocatorConfig::LoadNetConfig() { char szVal[ 256 ]; +#ifdef LOCATOR_FREESTANDING GetPrivateProfileString( "NETWORK", "IP", "", szVal, 255, LOCATOR_CONFIG ); if( 0 == strlen(szVal) ) return false; SetLocatorIP( szVal ); +#endif GetPrivateProfileString( "NETWORK", "PORT", "", szVal, 255, LOCATOR_CONFIG ); if( 0 == strlen(szVal) ) return false;