From f7c8a499d50d54329e72784a0f6a94a9c9cba9fc Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Sat, 25 Jul 2015 01:18:45 +0300 Subject: [PATCH] Unload the GeoIP db when disabled. --- src/core/net/geoipmanager.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/net/geoipmanager.cpp b/src/core/net/geoipmanager.cpp index d54888798..cd0ed797a 100644 --- a/src/core/net/geoipmanager.cpp +++ b/src/core/net/geoipmanager.cpp @@ -403,8 +403,13 @@ 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; + } } }