mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 04:04:16 +00:00
proper termination
This commit is contained in:
parent
81a7253e0f
commit
11402708da
5
Queue.h
5
Queue.h
@ -134,13 +134,14 @@ namespace util
|
|||||||
}
|
}
|
||||||
if (m_OnEmpty != nullptr)
|
if (m_OnEmpty != nullptr)
|
||||||
m_OnEmpty ();
|
m_OnEmpty ();
|
||||||
Queue<Msg>::Wait ();
|
if (m_IsRunning)
|
||||||
|
Queue<Msg>::Wait ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
bool m_IsRunning;
|
volatile bool m_IsRunning;
|
||||||
std::thread m_Thread;
|
std::thread m_Thread;
|
||||||
OnEmpty m_OnEmpty;
|
OnEmpty m_OnEmpty;
|
||||||
};
|
};
|
||||||
|
@ -142,6 +142,7 @@ namespace i2p
|
|||||||
delete session.second;
|
delete session.second;
|
||||||
m_NTCPSessions.clear ();
|
m_NTCPSessions.clear ();
|
||||||
delete m_NTCPAcceptor;
|
delete m_NTCPAcceptor;
|
||||||
|
m_NTCPAcceptor = nullptr;
|
||||||
|
|
||||||
m_DHKeysPairSupplier.Stop ();
|
m_DHKeysPairSupplier.Stop ();
|
||||||
m_IsRunning = false;
|
m_IsRunning = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user