Skip to content

Commit

Permalink
On macOS, fix deadlock during nested event loops (e.g. rfd)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpnurmi authored Oct 25, 2023
1 parent 62ed51a commit f4e71a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Unreleased` header.
# Unreleased

- On Windows, fix deadlock when accessing the state during `Cursor{Enter,Leave}`.
- On macOS, fix deadlock when entering a nested event loop from an event handler.

# 0.29.2

Expand Down
4 changes: 2 additions & 2 deletions src/platform_impl/macos/app_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,9 @@ impl AppState {

// Return when in callback due to https://github.com/rust-windowing/winit/issues/1779
if panic_info.is_panicking()
|| HANDLER.get_in_callback()
|| !HANDLER.have_callback()
|| !HANDLER.is_running()
|| HANDLER.get_in_callback()
{
return;
}
Expand Down Expand Up @@ -601,9 +601,9 @@ impl AppState {
// XXX: how does it make sense that `get_in_callback()` can ever return `true` here if we're
// about to return to the `CFRunLoop` to poll for new events?
if panic_info.is_panicking()
|| HANDLER.get_in_callback()
|| !HANDLER.have_callback()
|| !HANDLER.is_running()
|| HANDLER.get_in_callback()
{
return;
}
Expand Down

0 comments on commit f4e71a1

Please sign in to comment.