Skip to content

Commit

Permalink
remove contexts last in update
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisFloofyKitsune authored and p2004a committed Apr 15, 2024
1 parent 0d7d2ec commit 27654c0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions rts/Rml/Backends/RmlUi_Backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,6 @@ void RmlGui::Update()
for (const auto& context : state->contexts) {
context->Update();
}

if unlikely(!state->contexts_to_remove.empty()) {
for (const auto& context : state->contexts_to_remove) {
Rml::RemoveContext(context->GetName());
}
state->contexts_to_remove.clear();
}

if (state->clicked_context) {
auto context_pos = std::ranges::find(state->contexts, state->clicked_context);
Expand All @@ -348,6 +341,13 @@ void RmlGui::Update()
}
state->clicked_context = nullptr;
}

if unlikely(!state->contexts_to_remove.empty()) {
for (const auto& context : state->contexts_to_remove) {
Rml::RemoveContext(context->GetName());
}
state->contexts_to_remove.clear();
}
#endif
}

Expand Down

0 comments on commit 27654c0

Please sign in to comment.