-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fix Android crash on resume with Glow backend #3867
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just like with #3847, please don't put things behind cfg
s that should function generically.
I actually think that without these cfg's it should work on all platforms but it's need to be tested
Will change and test it tomorrow. Changing to draft for now |
Thanks! Can you also test if they can be simplfied/removed again on I'm by no means an expert on Any state that is implicitly/indirectly owned by a surface should be destroyed in egui/crates/eframe/src/native/wgpu_integration.rs Lines 47 to 58 in aa67d31
egui/crates/eframe/src/native/glow_integration.rs Lines 69 to 95 in aa67d31
While at it, can you remove this comment?: egui/crates/eframe/src/native/glow_integration.rs Lines 42 to 52 in aa67d31
It is no longer valid. Finally, what about #3676? |
After digging deeper in codebase i have found that there is a way to fix this bug without dropping ROOT viewport. The same can be done with wgpu but don't know if i should do it in this pr. |
works fine |
I am not familiar enough with Glad to have the code platform-agnostic. Can you retroactively apply the same to the |
I have a branch with wgpu changed already. But it requires to make bigger changes. I had to move some code around to make borrow checker work. Now it looks more similar to glow structure so it should be better. But i think it better to make another pr that refreshes wgpu integration(move\clean code + add comments) to catch up with glow then change Suspend/Resume cycle. |
@Garoven sounds good, looking forward to see that PR and I agree that the Indeed such changes are better served in a separate PR to lighten the review/testing burden 👍 |
Now I think that everything is good so it's time to re-open this pr. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was a very pleasant diff!
Addition for #3847
In previous one i only fixed crash occurring with Wgpu backend. This fixes crash with Glow backend as well.
I only tested this change with android so most things i changed are behind
#[cfg(target_os = "android")]
.Both fixes are dirty thought. As #3172 says that "The root viewport is the original viewport, and cannot be closed without closing the application.". So they break rules i guess? But i can't think about better solution for now.
Closes #3861.