You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Context::load_texture acquires a read lock to the context's InputState, which is unexpected. I discovered this by accidentally holding a handle from Context::input_mut for longer than necessary, and calling load_texture with it held. At time of writing, the lock is acquired here: https://github.com/emilk/egui/blob/master/crates/egui/src/context.rs#L755
To Reproduce
Steps to reproduce the behavior:
Call Context::input_mut in your UI code to query user inputs.
Later (perhaps in response to user action consumed with InputState::consume_key), call Context::load_texture, before the MappedRwLockWriteGuard from input_mut is dropped.
I can write a minimal working example later if needed, but hopefully this is clear enough.
Expected behavior
Texture loading code would not interact with InputState.
Screenshots
N/A
Desktop (please complete the following information):
This isn't OS specific.
Additional context
It seems strange that loading a texture would have anything to do with the user input, but this could reasonably be solved by documenting this behavior on Context::load_texture. It's easy enough to work around (just drop the lock guard earlier), but it's tricky to realize what's happening without debugging egui code.
The text was updated successfully, but these errors were encountered:
Describe the bug
Context::load_texture
acquires a read lock to the context'sInputState
, which is unexpected. I discovered this by accidentally holding a handle fromContext::input_mut
for longer than necessary, and callingload_texture
with it held. At time of writing, the lock is acquired here: https://github.com/emilk/egui/blob/master/crates/egui/src/context.rs#L755To Reproduce
Steps to reproduce the behavior:
Context::input_mut
in your UI code to query user inputs.InputState::consume_key
), callContext::load_texture
, before theMappedRwLockWriteGuard
frominput_mut
is dropped.I can write a minimal working example later if needed, but hopefully this is clear enough.
Expected behavior
Texture loading code would not interact with
InputState
.Screenshots
N/A
Desktop (please complete the following information):
This isn't OS specific.
Additional context
It seems strange that loading a texture would have anything to do with the user input, but this could reasonably be solved by documenting this behavior on
Context::load_texture
. It's easy enough to work around (just drop the lock guard earlier), but it's tricky to realize what's happening without debugging egui code.The text was updated successfully, but these errors were encountered: