From 708a40d0da8c127c098a55dcc9c76f57c0bea499 Mon Sep 17 00:00:00 2001 From: Ferdinand Schober Date: Fri, 6 Feb 2026 15:29:24 +0100 Subject: [PATCH] macos: fix memory leak probably should use an AutoreleasePool as well --- input-capture/src/macos.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/input-capture/src/macos.rs b/input-capture/src/macos.rs index 0d4138c..c68f6e7 100644 --- a/input-capture/src/macos.rs +++ b/input-capture/src/macos.rs @@ -453,8 +453,10 @@ fn create_event_tap<'a>( // Returning Drop should stop the event from being processed // but core fundation still returns the event cg_ev.set_type(CGEventType::Null); + CallbackResult::Drop + } else { + CallbackResult::Keep } - CallbackResult::Replace(cg_ev.to_owned()) }; let tap = CGEventTap::new(