Skip to content

Commit

Permalink
fixed PGWarnings not being thread-safe
Browse files Browse the repository at this point in the history
  • Loading branch information
hakasapl committed Dec 9, 2024
1 parent cce84c4 commit ad21342
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions ParallaxGenLib/src/ParallaxGenWarnings.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "ParallaxGenWarnings.hpp"

#include <mutex>
#include <spdlog/spdlog.h>

using namespace std;
Expand Down Expand Up @@ -46,8 +47,15 @@ void ParallaxGenWarnings::mismatchWarn(const wstring &MatchedPath, const wstring
return;
}

MismatchWarnDebugTracker[MatchedPathMod].insert(std::make_pair(MatchedPath,BaseTex));
MismatchWarnTracker[MatchedPathMod].insert(BaseTexMod);
{
const lock_guard<mutex> Lock(MismatchWarnDebugTrackerMutex);
MismatchWarnDebugTracker[MatchedPathMod].insert(std::make_pair(MatchedPath,BaseTex));
}

{
const lock_guard<mutex> Lock2(MismatchWarnTrackerMutex);
MismatchWarnTracker[MatchedPathMod].insert(BaseTexMod);
}
}

void ParallaxGenWarnings::printWarnings() {
Expand Down Expand Up @@ -132,9 +140,4 @@ void ParallaxGenWarnings::meshWarn(const wstring &MatchedPath, const wstring &NI
// add to tracker if not
MeshWarnTracker.insert(Key);
}

// log warning
//spdlog::warn(
// L"[Potential Mesh Mismatch] Mod \"{}\" assets were used on meshes from mod \"{}\". Please verify that this is intended.",
// MatchedPathMod, NIFPathMod);
}

0 comments on commit ad21342

Please sign in to comment.