From 2546c042dcbe61b7893d888cb28178988bcecc9e Mon Sep 17 00:00:00 2001 From: WerWolv Date: Fri, 17 May 2024 23:16:49 +0200 Subject: [PATCH] fix: Crash when clicking on Advanced search in find popup --- .../popups/hex_editor/popup_hex_editor_find.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/builtin/source/content/popups/hex_editor/popup_hex_editor_find.cpp b/plugins/builtin/source/content/popups/hex_editor/popup_hex_editor_find.cpp index c9221303d..bc67b02cb 100644 --- a/plugins/builtin/source/content/popups/hex_editor/popup_hex_editor_find.cpp +++ b/plugins/builtin/source/content/popups/hex_editor/popup_hex_editor_find.cpp @@ -47,10 +47,13 @@ namespace hex::plugin::builtin { } if(ImGuiExt::IconHyperlink(ICON_VS_SEARCH, "hex.builtin.view.hex_editor.search.advanced"_lang)) { - const auto& view = ContentRegistry::Views::getViewByName("hex.builtin.view.find.name"); - view->getWindowOpenState() = true; - ImGui::SetWindowFocus(view->getName().c_str()); - editor->closePopup(); + TaskManager::doLater([&editor] { + const auto& view = ContentRegistry::Views::getViewByName("hex.builtin.view.find.name"); + + view->getWindowOpenState() = true; + ImGui::SetWindowFocus(view->getName().c_str()); + editor->closePopup(); + }); } if (lastMode != *s_searchMode) {