Unload the GeoIP db when disabled.

This commit is contained in:
sledgehammer999 2015-07-25 01:18:45 +03:00
parent ad7ad8f596
commit f7c8a499d5

View File

@ -403,8 +403,13 @@ void GeoIPManager::configure()
const bool enabled = Preferences::instance()->resolvePeerCountries(); const bool enabled = Preferences::instance()->resolvePeerCountries();
if (m_enabled != enabled) { if (m_enabled != enabled) {
m_enabled = enabled; m_enabled = enabled;
if (m_enabled && !m_geoIPDatabase) if (m_enabled && !m_geoIPDatabase) {
loadDatabase(); loadDatabase();
}
else if (!m_enabled && m_geoIPDatabase) {
delete m_geoIPDatabase;
m_geoIPDatabase = 0;
}
} }
} }