Fix bitmrc deadlock

This commit is contained in:
momo5502 2016-10-03 02:22:58 +02:00
parent b3c0487797
commit 961f2b0a0b

View File

@ -185,7 +185,14 @@ namespace Components
BitMessage::~BitMessage() BitMessage::~BitMessage()
{ {
delete BitMessage::BMClient; BitMessage::Save();
// We have to do that in another thread, as sometims the terminating thread already holds the mutex lock...
std::thread([&] ()
{
delete BitMessage::BMClient;
}).join();
BitMessage::BMClient = nullptr; BitMessage::BMClient = nullptr;
} }