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,9 +403,14 @@ void GeoIPManager::configure()
const bool enabled = Preferences::instance()->resolvePeerCountries();
if (m_enabled != enabled) {
m_enabled = enabled;
if (m_enabled && !m_geoIPDatabase)
if (m_enabled && !m_geoIPDatabase) {
loadDatabase();
}
else if (!m_enabled && m_geoIPDatabase) {
delete m_geoIPDatabase;
m_geoIPDatabase = 0;
}
}
}
void GeoIPManager::downloadFinished(const QString &url, QByteArray data)