From 816eb3c9931c131d2841f027a9757a22537e85ca Mon Sep 17 00:00:00 2001 From: Cliff Hudson Date: Sat, 11 Nov 2023 17:56:47 -0800 Subject: [PATCH 1/2] Port fix for rust-windowing/winit/issues/2291 --- src/platform_impl/windows/event_loop.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/platform_impl/windows/event_loop.rs b/src/platform_impl/windows/event_loop.rs index 6d5f9d44a5..91d044a3ec 100644 --- a/src/platform_impl/windows/event_loop.rs +++ b/src/platform_impl/windows/event_loop.rs @@ -2538,7 +2538,9 @@ unsafe extern "system" fn thread_event_target_callback( } } } - userdata.event_loop_runner.poll(); + if !userdata.event_loop_runner.should_buffer() { + userdata.event_loop_runner.poll(); + } 0 } _ => DefWindowProcW(window, msg, wparam, lparam), From d43a2f3ca63756eb4cc8aca9110af7a3e1b4519d Mon Sep 17 00:00:00 2001 From: Cliff Hudson Date: Sat, 11 Nov 2023 17:59:16 -0800 Subject: [PATCH 2/2] Update Changelog for previous fix --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61a2f5fd27..d215321ff1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ And please only add new entries to the top of this list, right below the `# Unre # Unreleased +- On Windows, fix re-entrant event loop crash from rust-windowing/winit/issues/2291 + # 0.28.6 - On macOS, fixed memory leak when getting monitor handle.