From 2f6e91cd9ee3e70c583e136b97653543ef44dc47 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Mon, 27 Sep 2021 15:04:30 +0200 Subject: [PATCH] fix: Open Popup crash --- source/window/window.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/source/window/window.cpp b/source/window/window.cpp index ac2f3a5b2..4caf85a71 100644 --- a/source/window/window.cpp +++ b/source/window/window.cpp @@ -459,12 +459,14 @@ namespace hex { ImGui::EndPopup(); } - for (auto it = this->m_popupsToOpen.begin(); it != this->m_popupsToOpen.end(); it++) { - if (ImGui::IsPopupOpen(it->c_str())) - this->m_popupsToOpen.erase(it); + this->m_popupsToOpen.remove_if([](const auto &name) { + if (ImGui::IsPopupOpen(name.c_str())) + return true; else - ImGui::OpenPopup(it->c_str()); - } + ImGui::OpenPopup(name.c_str()); + + return false; + }); } void Window::frame() {