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

ImGui render context race condition fix: Lock context during Init/Shutdown. #11258

Merged
merged 2 commits into from Nov 7, 2022

Conversation

AdmiralCurtiss
Copy link
Contributor

Fix for https://bugs.dolphin-emu.org/issues/12652. Includes the commit from #10458.

@Pokechu22 As far as I can tell this works fine, can you see if you can figure out why you thought you couldn't acquire the lock during shutdown?

Pokechu22 and others added 2 commits November 6, 2022 21:41
`ImGui::GetIO` performs an assertion that a context exists, and if one doesn't then things will likely crash.  Unfortunately this crash is hard to consistently reproduce.
@Pokechu22
Copy link
Contributor

I think it was probably needing to split BeginImGuiFrame to also have BeginImGuiFrameUnlocked, but there's also Renderer::DrawImGui being called without the lock held which seems somewhat odd (but maybe fine?).

@AdmiralCurtiss
Copy link
Contributor Author

I agree that is a bit odd, but I don't really know the rendering logic well enough to say whether it's possible for that to be executed at an inopportune time, so... I guess it's fine for now?

@Pokechu22
Copy link
Contributor

Better than it was before, in any case.

@AdmiralCurtiss
Copy link
Contributor Author

Reporter confirmed that this fixes their problem, so I'm gonna merge this.

@AdmiralCurtiss AdmiralCurtiss merged commit ee7887b into dolphin-emu:master Nov 7, 2022
11 checks passed
@AdmiralCurtiss AdmiralCurtiss deleted the imgui-crash-v2 branch November 7, 2022 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants