mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-29 00:23:48 +00:00
fix(Core/Maps): prevet a crash occurring when shutting the server down. (#7387)
This commit is contained in:
@@ -67,6 +67,7 @@ MapUpdater::~MapUpdater()
|
|||||||
|
|
||||||
void MapUpdater::activate(size_t num_threads)
|
void MapUpdater::activate(size_t num_threads)
|
||||||
{
|
{
|
||||||
|
_workerThreads.reserve(num_threads);
|
||||||
for (size_t i = 0; i < num_threads; ++i)
|
for (size_t i = 0; i < num_threads; ++i)
|
||||||
{
|
{
|
||||||
_workerThreads.push_back(std::thread(&MapUpdater::WorkerThread, this));
|
_workerThreads.push_back(std::thread(&MapUpdater::WorkerThread, this));
|
||||||
@@ -83,7 +84,10 @@ void MapUpdater::deactivate()
|
|||||||
|
|
||||||
for (auto& thread : _workerThreads)
|
for (auto& thread : _workerThreads)
|
||||||
{
|
{
|
||||||
thread.join();
|
if (thread.joinable())
|
||||||
|
{
|
||||||
|
thread.join();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user