Skip to content

Fixed possible ImGui assertions#977

Open
Lukas1811 wants to merge 1 commit intongscopeclient:masterfrom
Lukas1811:fix-end-child-assertion
Open

Fixed possible ImGui assertions#977
Lukas1811 wants to merge 1 commit intongscopeclient:masterfrom
Lukas1811:fix-end-child-assertion

Conversation

@Lukas1811
Copy link

There were two cases were ImGui::EndChild was only called when BeginChild returned true.
This could lead to some assertions in ImGui like mentioned in #943.

Begin/BeginChild and End/EndChild are special cases according to comments in ImGui at the definition of Begin and End:

// - Begin() return false to indicate the window is collapsed or fully clipped, so you may early out and omit submitting
//   anything to the window. Always call a matching End() for each Begin() call, regardless of its return value!
//   [Important: due to legacy reason, Begin/End and BeginChild/EndChild are inconsistent with all other functions
//    such as BeginMenu/EndMenu, BeginPopup/EndPopup, etc. where the EndXXX call should only be called if the corresponding
//    BeginXXX function returned true. Begin and BeginChild are the only odd ones out. Will be fixed in a future update.]

In both cases it was possible that BeginChild was called but not EndChild
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant