Skip to content

Conversation

emilk
Copy link
Owner

@emilk emilk commented Jan 8, 2022

Closes #1005

Rebased and continued from #1035

Most of the work was done by @danielkeller

  • Everything in a Context is now behind the same mutex.
  • ⚠️ Context::input and Ui::input now locks a mutex. This can lead to a dead-lock is used in an if let binding!
    • if let Some(pos) = ui.input().pointer.latest_pos() and similar must now be rewritten on two lines, or with added {} around the righ-hand-side.
    • Search for this problem in your code using the regex if let .*input.
  • Context::fonts and Ui::fonts now locks a mutex.
  • Renamed CtxRef to Context.
  • Context can now be cloned and stored between frames.

@emilk emilk mentioned this pull request Jan 8, 2022
emilk added 3 commits January 8, 2022 13:39
The old `Context` is now `ContextImpl` and is non-pub
@emilk emilk changed the title Put everything in Context behind the same Mutex (rebased) Put everything in Context behind the same Mutex Jan 8, 2022
@emilk emilk marked this pull request as ready for review January 8, 2022 16:00
@emilk emilk merged commit d567341 into master Jan 10, 2022
@emilk emilk deleted the ctx-handle-rebased branch January 10, 2022 22:13
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.

CtxRef::clone is a footgun
2 participants