From ba35762af2a1c89e7d7c0f2b88068794a44c9765 Mon Sep 17 00:00:00 2001 From: i509VCB Date: Wed, 20 Dec 2023 23:04:46 -0600 Subject: [PATCH] fix borrow error when scheduling future inside an executor's callback --- src/sources/futures.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sources/futures.rs b/src/sources/futures.rs index 0207dc87..3a56e005 100644 --- a/src/sources/futures.rs +++ b/src/sources/futures.rs @@ -329,6 +329,9 @@ impl EventSource for Executor { _ => unreachable!(), }; + // Drop the guard since the callback may register another future to the scheduler. + drop(active_guard); + callback(result, &mut ()); } }