fix: Race condition causing old patterns to stick around in the pattern drawer

(cherry picked from commit da6e7240d6)
This commit is contained in:
WerWolv
2025-12-28 17:46:22 +01:00
parent 5fa5bef467
commit a20f165421

View File

@@ -1680,10 +1680,11 @@ namespace hex::plugin::builtin {
}
void ViewPatternEditor::evaluatePattern(const std::string &code, prv::Provider *provider) {
EventPatternEvaluating::post();
auto lock = std::scoped_lock(ContentRegistry::PatternLanguage::getRuntimeLock());
ContentRegistry::PatternLanguage::getRuntime().reset();
EventPatternEvaluating::post();
m_runningEvaluators += 1;
m_executionDone.get(provider) = false;