fix: Various invalid iterator and container accesses

This commit is contained in:
WerWolv
2023-01-01 01:01:24 +01:00
parent 921bdd9e3b
commit 87ed0d31d4
8 changed files with 11 additions and 8 deletions

View File

@@ -42,7 +42,7 @@ namespace hex::plugin::builtin {
}
void ViewDataInspector::drawContent() {
if (this->m_dataValid) {
if (this->m_dataValid && !this->m_updateTask.isRunning()) {
this->m_dataValid = false;
this->m_cachedData = std::move(this->m_workData);
}

View File

@@ -140,7 +140,7 @@ namespace hex::plugin::builtin {
std::array<ImU64, 256> blockValueCounts = { 0 };
const auto blockCount = provider->getSize() / this->m_blockSize;
const auto blockCount = (provider->getSize() / this->m_blockSize) + 1;
this->m_blockTypeDistributions.fill({});
this->m_blockEntropy.clear();

View File

@@ -22,12 +22,13 @@ namespace hex::plugin::builtin {
if (ImGui::IsMouseClicked(0) && ImGui::IsItemActivated() && this->m_dragStartIterator == tools.end())
this->m_dragStartIterator = iter;
if (!ImGui::IsMouseDown(0))
this->m_dragStartIterator = tools.end();
if (!ImGui::IsItemHovered() && this->m_dragStartIterator == iter) {
detached = true;
}
if (!ImGui::IsMouseDown(0))
this->m_dragStartIterator = tools.end();
}
}
}