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

Feature/setroot #96

Merged
merged 3 commits into from
Jan 11, 2024
Merged

Feature/setroot #96

merged 3 commits into from
Jan 11, 2024

Conversation

FigBug
Copy link
Collaborator

@FigBug FigBug commented Jan 8, 2024

Add Inspector::setRoot so the component that is being inspected can change. Optionally, the component being inspected can be whatever top level juce component is under the mouse.

@sudara
Copy link
Owner

sudara commented Jan 11, 2024

Trying this out locally, I triggered an assert on inspector_component:194

jassert (selectComponentCallback);

and then pushing through that, things crashed in MessageManager::runDispatchLoop()

@sudara
Copy link
Owner

sudara commented Jan 11, 2024

It seems like setRoot (which calls ensureTreeIsConstructed) is being called before the callbacks are setup.

It happens when i click my button to construct:

            inspector = std::make_unique<melatonin::Inspector> (*this);
            inspector->onClose = [this]() { inspector.reset(); };

@FigBug
Copy link
Collaborator Author

FigBug commented Jan 11, 2024

Looks like bool inspectorEnabled is never initialized. So this error occurs if it is randomly initialized to 'true'. Setting it to false resolves the issue.

@sudara sudara merged commit a422fea into main Jan 11, 2024
8 checks passed
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.

2 participants