fix(Core/Crash): Fix a crash occurring when shutting the server down.

This commit is contained in:
lineagedr
2021-08-16 18:26:31 +03:00
parent c15d98aa64
commit 23beddb209

View File

@@ -67,6 +67,7 @@ MapUpdater::~MapUpdater()
void MapUpdater::activate(size_t num_threads)
{
_workerThreads.reserve(num_threads);
for (size_t i = 0; i < num_threads; ++i)
{
_workerThreads.push_back(std::thread(&MapUpdater::WorkerThread, this));
@@ -83,7 +84,10 @@ void MapUpdater::deactivate()
for (auto& thread : _workerThreads)
{
thread.join();
if (thread.joinable())
{
thread.join();
}
}
}