fix: Crash when closing section with selected bytes
This commit is contained in:
parent
3d5190f51a
commit
7d0474335a
@ -21,6 +21,7 @@ namespace hex::plugin::builtin {
|
||||
EventManager::subscribe<EventRegionSelected>(this, [this](const auto ®ion) {
|
||||
if (!ImHexApi::Provider::isValid() || region == Region::Invalid()) {
|
||||
this->m_validBytes = 0;
|
||||
this->m_selectedProvider = nullptr;
|
||||
} else {
|
||||
this->m_validBytes = u64(region.getProvider()->getActualSize() - region.address);
|
||||
this->m_startAddress = region.address;
|
||||
|
@ -864,6 +864,7 @@ namespace hex::plugin::builtin {
|
||||
|
||||
providerData.selectionStart.reset();
|
||||
providerData.selectionEnd.reset();
|
||||
EventManager::post<EventRegionSelected>(ImHexApi::HexEditor::ProviderRegion({ Region::Invalid(), nullptr }));
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -524,8 +524,10 @@ namespace hex::plugin::builtin {
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
if (!open)
|
||||
if (!open && this->m_sectionWindowDrawer.contains(provider)) {
|
||||
ImHexApi::HexEditor::setSelection(Region::Invalid());
|
||||
this->m_sectionWindowDrawer.erase(provider);
|
||||
}
|
||||
|
||||
auto &extraData = ProviderExtraData::get(provider).patternLanguage;
|
||||
if (!this->m_lastEvaluationProcessed) {
|
||||
|
Loading…
Reference in New Issue
Block a user