Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ColorPicker crashes after selecting ColorPicker, then Textbox then back to ColorPicker again #2023

Closed
SSBMTonberry opened this issue Aug 16, 2018 · 1 comment

Comments

@SSBMTonberry
Copy link

Hello!
First of all: I'm using ImGui version 1.62.

I discovered something weird when selecting a ImGui::ColorPicker3, then ImGui::InputText and then ImGui::ColorPicker3 again in my own project. Basicly the result was that the program crashed.
At first, I thought that I did something weird that might have caused it, but then I tried to do the same thing in the demo, and ended up with getting the same crash. The demo uses ImGui::ColorPicker4, but the result is the same.

How to reproduce:

Select the colorpicker in the demo (Under Widgets->Color/Picker Widgets):
image

Then select the textbox saying "Hello, world!" and has the label "input text" (under Widgets->Basic):
image

THEN, click on the colorpicker again.
image

The program will crash at the following place, if you experience the same as me:
image

Or as text:

void ImGui::MarkItemValueChanged(ImGuiID id)
{
    // This marking is solely to be able to provide info for IsItemDeactivatedAfterChange().
    // ActiveId might have been released by the time we call this (as in the typical press/release button behavior) but still need need to fill the data.
    (void)id; // Avoid unused variable warnings when asserts are compiled out.
    ImGuiContext& g = *GImGui;
    IM_ASSERT(g.ActiveId == id || g.ActiveId == 0);
    g.ActiveIdValueChanged = true;
}

Call-stack:
image

Hope this describes the issue well enough :)

  • Robin
@ocornut ocornut added the bug label Aug 16, 2018
ocornut added a commit that referenced this issue Aug 16, 2018
…n a group, affecting ColorPicker (broken in 1.62). Made ActiveIdIsAlive track the actual ID to avoid incorrect polling in BeginGroup/EndGroup when the ID changes within the group. (#2023, #820, #956, #1875).
@ocornut
Copy link
Owner

ocornut commented Aug 16, 2018

Thank you @SSBMTonberry for the detailed bug report!
I pushed a fix for it now (this was a tricky one!).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants