proper termination

This commit is contained in:
orignal 2014-09-22 14:44:10 -04:00
parent 81a7253e0f
commit 11402708da
2 changed files with 4 additions and 2 deletions

View File

@ -134,13 +134,14 @@ namespace util
}
if (m_OnEmpty != nullptr)
m_OnEmpty ();
Queue<Msg>::Wait ();
if (m_IsRunning)
Queue<Msg>::Wait ();
}
}
private:
bool m_IsRunning;
volatile bool m_IsRunning;
std::thread m_Thread;
OnEmpty m_OnEmpty;
};

View File

@ -142,6 +142,7 @@ namespace i2p
delete session.second;
m_NTCPSessions.clear ();
delete m_NTCPAcceptor;
m_NTCPAcceptor = nullptr;
m_DHKeysPairSupplier.Stop ();
m_IsRunning = false;