delete obsolete profiles

This commit is contained in:
orignal 2015-04-11 15:39:23 -04:00
parent 1839b85d97
commit 128a8f3b48
3 changed files with 49 additions and 14 deletions

View file

@ -65,19 +65,24 @@ namespace data
void NetDb::Stop ()
{
for (auto it: m_RouterInfos)
it.second->SaveProfile ();
m_RouterInfos.clear ();
if (m_Thread)
if (m_IsRunning)
{
m_IsRunning = false;
m_Queue.WakeUp ();
m_Thread->join ();
delete m_Thread;
m_Thread = 0;
}
m_LeaseSets.clear();
m_Requests.Stop ();
for (auto it: m_RouterInfos)
it.second->SaveProfile ();
DeleteObsoleteProfiles ();
m_RouterInfos.clear ();
m_Floodfills.clear ();
if (m_Thread)
{
m_IsRunning = false;
m_Queue.WakeUp ();
m_Thread->join ();
delete m_Thread;
m_Thread = 0;
}
m_LeaseSets.clear();
m_Requests.Stop ();
}
}
void NetDb::Run ()