diff --git a/main/gui/source/window/window.cpp b/main/gui/source/window/window.cpp index 066141b68..a14dc0414 100644 --- a/main/gui/source/window/window.cpp +++ b/main/gui/source/window/window.cpp @@ -569,6 +569,12 @@ namespace hex { ImGui::SameLine(); } + if (auto provider = ImHexApi::Provider::get(); provider != nullptr) { + if (ImGui::CloseButton(ImGui::GetID("ProviderCloseButton"), ImGui::GetCursorScreenPos() + ImVec2(ImGui::GetContentRegionAvail().x - 17_scaled, 3_scaled))) { + ImHexApi::Provider::remove(provider); + } + } + ImGui::EndMenuBar(); } diff --git a/plugins/builtin/include/content/providers/null_provider.hpp b/plugins/builtin/include/content/providers/null_provider.hpp index ff3a3e328..00c7769b5 100644 --- a/plugins/builtin/include/content/providers/null_provider.hpp +++ b/plugins/builtin/include/content/providers/null_provider.hpp @@ -11,7 +11,7 @@ namespace hex::plugin::builtin { EventManager::subscribe([this](auto *newProvider) { if (newProvider == this) return; - + ImHexApi::Provider::remove(this, true); }); }