From a2dd37118abec04b752c8b861a938abc2456e7b3 Mon Sep 17 00:00:00 2001 From: Victor Mignot Date: Tue, 2 May 2023 18:08:23 +0200 Subject: [PATCH] Fix deadlock when two users use selector at the same time --- src/discord/event_handler.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/discord/event_handler.rs b/src/discord/event_handler.rs index ce9f368..33071ae 100644 --- a/src/discord/event_handler.rs +++ b/src/discord/event_handler.rs @@ -153,6 +153,7 @@ impl EventHandler for Handler { .run(ctx.clone(), self.database.clone()) .await } else { + drop(users_selector); Err(CommandExecutionError::SelectorError( "User has already a selector running".to_string(), )) @@ -169,6 +170,7 @@ impl EventHandler for Handler { .run(ctx.clone(), self.database.clone()) .await } else { + drop(users_selector); Err(CommandExecutionError::SelectorError( "User has already a selector running".to_string(), ))