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

Fixing an imgui-related crash related to debug errors #72074

Merged

Conversation

katemonster33
Copy link
Contributor

Summary

Bugfixes "When a debug error is thrown during drawing, imgui itself throws an exception, crashing the game"

Purpose of change

When draw errors happen, we expect to see the debug message. Instead, CDDA crashes. This prevents this
Fixes: #72047

Describe the solution

Added a boolean in ui_manager.cpp to prevent cataimgui::client::new_frame to be called twice in a row

Describe alternatives you've considered

Could have added the boolean inside cataimgui::client::new_frame but currently there are multiple definitions, for curses and SDL. This bypasses needing to make the same change in 2 places

Testing

Loaded the save specified in the linked issue and verified the debug error is shown

Additional context

@github-actions github-actions bot added Info / User Interface Game - player communication, menus, etc. [C++] Changes (can be) made in C++. Previously named `Code` labels Feb 29, 2024
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-requesting reviews from non-collaborators: @Qrox

@github-actions github-actions bot added <Bugfix> This is a fix for a bug (or closes open issue) astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Feb 29, 2024
@Maleclypse Maleclypse merged commit c364b31 into CleverRaven:master Mar 1, 2024
27 of 28 checks passed
@Qrox
Copy link
Contributor

Qrox commented Mar 1, 2024

When a debug message is thrown and dismissed, the ui_manager code will restart drawing all windows to resume the content overwritten by the debug message. Will this cause the UI to contain extra elements due to it drawing an ImGUI window multiple times in a single frame?

@IdleSol IdleSol mentioned this pull request Mar 1, 2024
@katemonster33
Copy link
Contributor Author

@Qrox hmm, im not sure. I guess I would need some way of making that behavior happen with an ImGui window on screen. I could see it being possible.

SurFlurer added a commit to SurFlurer/Cataclysm-DDA that referenced this pull request Mar 19, 2024
…_draw_debug_error_crash"

This reverts commit c364b31, reversing
changes made to 0aff7d5.
SurFlurer added a commit to SurFlurer/Cataclysm-DDA that referenced this pull request Mar 19, 2024
…_draw_debug_error_crash"

This reverts commit c364b31, reversing
changes made to 0aff7d5.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Info / User Interface Game - player communication, menus, etc. json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash when drawing vehicle from above
3 participants