1
0
forked from 0ad/0ad

Fix e83f24e3a6 and 1ff20e8f6a miniupnpc leak and crash on thread exit.

std::thread crashes when destroyed without being joined or detached.
Joining would wait on the UPnP thread, which can take upwards of 10
seconds, so detach instead.

Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D2181
This was SVN commit r22674.
This commit is contained in:
wraitii 2019-08-16 17:38:58 +00:00
parent c2e9e2263a
commit 8a4d2a8ccc

View File

@ -159,6 +159,11 @@ CNetServerWorker::~CNetServerWorker()
m_WorkerThread.join();
}
#if CONFIG2_MINIUPNPC
if (m_UPnPThread.joinable())
m_UPnPThread.detach();
#endif
// Clean up resources
delete m_Stats;