Fix bitmrc deadlock

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

View File

@ -184,8 +184,15 @@ namespace Components
} }
BitMessage::~BitMessage() BitMessage::~BitMessage()
{
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; delete BitMessage::BMClient;
}).join();
BitMessage::BMClient = nullptr; BitMessage::BMClient = nullptr;
} }