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;