1
0
mirror of synced 2025-01-30 03:27:25 +01:00

fix: Crash when re-opening a custom section window while having a selection in it

This commit is contained in:
WerWolv 2023-09-03 16:09:06 +02:00
parent 971c8739ca
commit b042b8327a

View File

@ -526,6 +526,9 @@ namespace hex::plugin::builtin {
dataProvider->writeRaw(0x00, section.data.data(), section.data.size());
dataProvider->setReadOnly(true);
if (auto selection = ImHexApi::HexEditor::getSelection(); selection.has_value() && selection->provider != ImHexApi::Provider::get())
EventManager::post<EventRegionSelected>(ImHexApi::HexEditor::ProviderRegion { { 0x00, 0x00 }, nullptr });
auto hexEditor = auto(this->m_sectionHexEditor);
hexEditor.setBackgroundHighlightCallback([this, id, &runtime](u64 address, const u8 *, size_t) -> std::optional<color_t> {