Skip to content

Commit

Permalink
Fix crash with Begin/EndChild behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Nov 4, 2023
1 parent 255732e commit 42a4b4f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/Framework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,8 @@ void Framework::draw_ui() {
ImGui::SetNextWindowFocus();
}

if (ImGui::BeginChild("UEVRRightPane", ImVec2(0, 0), true, ImGuiWindowFlags_::ImGuiWindowFlags_AlwaysUseWindowPadding)) {
ImGui::BeginChild("UEVRRightPane", ImVec2(0, 0), true, ImGuiWindowFlags_::ImGuiWindowFlags_AlwaysUseWindowPadding);
{
ImGui::BeginGroup();

if (m_sidebar_state.selected_entry > 0) {
Expand Down
9 changes: 5 additions & 4 deletions src/mods/UObjectHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1329,13 +1329,14 @@ void UObjectHook::on_draw_ui() {
}

const auto wide_filter = utility::widen(filter);

bool made_child = ImGui::BeginChild("Objects by class entries", ImVec2(0, 0), true, ImGuiWindowFlags_::ImGuiWindowFlags_HorizontalScrollbar);
const bool made_child = ImGui::BeginChild("Objects by class entries", ImVec2(0, 0), true, ImGuiWindowFlags_::ImGuiWindowFlags_HorizontalScrollbar);

utility::ScopeGuard sg{[made_child]() {
if (made_child) {
//if (made_child) {
// well apparently BeginChild doesn't care about if it returned true or not so...
// TODO: check this every time we update imgui?
ImGui::EndChild();
}
//}
}};

for (auto uclass : m_sorted_classes) {
Expand Down

0 comments on commit 42a4b4f

Please sign in to comment.