mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-03 12:04:15 +00:00
fixed possible crash at shutdown
This commit is contained in:
parent
7497741846
commit
3995448014
@ -55,6 +55,13 @@ namespace transport
|
|||||||
m_Thread->join ();
|
m_Thread->join ();
|
||||||
m_Thread = nullptr;
|
m_Thread = nullptr;
|
||||||
}
|
}
|
||||||
|
if (!m_Queue.empty ())
|
||||||
|
{
|
||||||
|
// clean up queue
|
||||||
|
std::queue<std::shared_ptr<Keys> > tmp;
|
||||||
|
std::swap (m_Queue, tmp);
|
||||||
|
}
|
||||||
|
m_KeysPool.CleanUpMt ();
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Keys>
|
template<typename Keys>
|
||||||
|
@ -54,8 +54,8 @@ namespace transport
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
const int m_QueueSize;
|
const int m_QueueSize;
|
||||||
std::queue<std::shared_ptr<Keys> > m_Queue;
|
|
||||||
i2p::util::MemoryPoolMt<Keys> m_KeysPool;
|
i2p::util::MemoryPoolMt<Keys> m_KeysPool;
|
||||||
|
std::queue<std::shared_ptr<Keys> > m_Queue;
|
||||||
|
|
||||||
bool m_IsRunning;
|
bool m_IsRunning;
|
||||||
std::unique_ptr<std::thread> m_Thread;
|
std::unique_ptr<std::thread> m_Thread;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user