From e4c8c5c6d41545fddacfceb1627188be6f228c57 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 ()); } }