From 563ff5a774510c91445c10a635985bdc2e9da962 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 3 Sep 2023 16:18:29 +0200 Subject: [PATCH] fix: Future proof the previous fix --- lib/libimhex/source/providers/provider.cpp | 3 +++ plugins/builtin/source/content/views/view_pattern_editor.cpp | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libimhex/source/providers/provider.cpp b/lib/libimhex/source/providers/provider.cpp index f4ea81282..e44056842 100644 --- a/lib/libimhex/source/providers/provider.cpp +++ b/lib/libimhex/source/providers/provider.cpp @@ -27,6 +27,9 @@ namespace hex::prv { Provider::~Provider() { this->m_overlays.clear(); + + if (auto selection = ImHexApi::HexEditor::getSelection(); selection.has_value() && selection->provider == this) + EventManager::post(ImHexApi::HexEditor::ProviderRegion { { 0x00, 0x00 }, nullptr }); } void Provider::read(u64 offset, void *buffer, size_t size, bool overlays) { diff --git a/plugins/builtin/source/content/views/view_pattern_editor.cpp b/plugins/builtin/source/content/views/view_pattern_editor.cpp index b8f516276..cd7dc63c4 100644 --- a/plugins/builtin/source/content/views/view_pattern_editor.cpp +++ b/plugins/builtin/source/content/views/view_pattern_editor.cpp @@ -526,9 +526,6 @@ 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(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 {