mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Vmaps: Fixed use after free and deadlocks when loading a model file fails
This commit is contained in:
@@ -100,7 +100,6 @@ namespace VMAP
|
||||
threadPool.PostWork([this, file = directoryEntry.path(), &abortThreads, &workerIndexGen, &spawnedModelFilesByThread, &mapsToProcess]
|
||||
{
|
||||
thread_local std::size_t workerIndex = workerIndexGen++;
|
||||
--mapsToProcess;
|
||||
|
||||
auto dirf = OpenFile(file, "rb");
|
||||
if (!dirf)
|
||||
@@ -127,6 +126,7 @@ namespace VMAP
|
||||
return abortThreads();
|
||||
|
||||
spawnedModelFilesByThread[workerIndex].merge(data.SpawnedModelFiles);
|
||||
--mapsToProcess;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user