fix: Multiple race conditions with pattern sorting

This commit is contained in:
WerWolv
2024-10-22 16:20:08 +02:00
parent 101c7a36fb
commit 3739bcc40c
10 changed files with 23 additions and 12 deletions

View File

@@ -1214,6 +1214,16 @@ namespace hex::ui {
}
void PatternDrawer::draw(const std::vector<std::shared_ptr<pl::ptrn::Pattern>> &patterns, const pl::PatternLanguage *runtime, float height) {
if (runtime == nullptr) {
this->reset();
} else {
auto runId = runtime->getRunId();
if (runId != m_lastRunId) {
this->reset();
m_lastRunId = runId;
}
}
std::scoped_lock lock(s_resetDrawMutex);
m_hoverCallback(nullptr);