From c7f46876a76f47819ec6ae4f8a0591817e695daf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Art=C3=BAr=20Kov=C3=A1cs?= Date: Sun, 13 Jun 2021 14:25:06 +0200 Subject: [PATCH] Drop the event callback before exiting on macOS (#1954) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Drop the event callback before exiting * Update the changelog * Apply suggestion from review Co-authored-by: Markus Røyset * Apply review suggestions Co-authored-by: Markus Røyset --- CHANGELOG.md | 1 + src/platform_impl/macos/event_loop.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 633b0269..28ecbf83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Unreleased +- On macOS, drop the event callback before exiting. - On Android, implement `Window::request_redraw` - **Breaking:** On Web, remove the `stdweb` backend. - Added `Window::focus_window`to bring the window to the front and set input focus. diff --git a/src/platform_impl/macos/event_loop.rs b/src/platform_impl/macos/event_loop.rs index 45a32306..7c5ceaeb 100644 --- a/src/platform_impl/macos/event_loop.rs +++ b/src/platform_impl/macos/event_loop.rs @@ -174,10 +174,12 @@ impl EventLoop { let () = msg_send![app, run]; if let Some(panic) = self.panic_info.take() { + drop(self._callback.take()); resume_unwind(panic); } AppState::exit(); }); + drop(self._callback.take()); } pub fn create_proxy(&self) -> Proxy {