fix: Race condition with data inspector

This commit is contained in:
WerWolv
2022-10-05 12:02:40 +02:00
parent 7bb9e7ee82
commit 7f2c60b0d7
4 changed files with 28 additions and 26 deletions

View File

@@ -37,6 +37,11 @@ namespace hex::plugin::builtin {
}
void ViewDataInspector::drawContent() {
if (this->m_dataValid) {
this->m_dataValid = false;
this->m_cachedData = std::move(this->m_workData);
}
if (this->m_shouldInvalidate && !this->m_updateTask.isRunning()) {
this->m_shouldInvalidate = false;
@@ -133,11 +138,6 @@ namespace hex::plugin::builtin {
});
}
if (this->m_dataValid) {
this->m_dataValid = false;
this->m_cachedData = this->m_workData;
}
if (ImGui::Begin(View::toWindowName("hex.builtin.view.data_inspector.name").c_str(), &this->getWindowOpenState(), ImGuiWindowFlags_NoCollapse)) {
auto provider = ImHexApi::Provider::get();