From 8d0acecdcfa49a5cc25d1c201fab8601a692b5e5 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 18 Nov 2023 02:24:34 -0600 Subject: fix memory leak when loading chunks in swarms --- azalea/examples/testbot.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'azalea/examples/testbot.rs') diff --git a/azalea/examples/testbot.rs b/azalea/examples/testbot.rs index 38f8d499..c47aa061 100644 --- a/azalea/examples/testbot.rs +++ b/azalea/examples/testbot.rs @@ -56,7 +56,7 @@ async fn main() -> anyhow::Result<()> { .add_accounts(accounts.clone()) .set_handler(handle) .set_swarm_handler(swarm_handle) - .join_delay(Duration::from_millis(1000)) + .join_delay(Duration::from_millis(100)) .start("localhost") .await; // let e = azalea::ClientBuilder::new() @@ -154,6 +154,11 @@ async fn handle(mut bot: Client, event: Event, _state: State) -> anyhow::Result< "lag" => { std::thread::sleep(Duration::from_millis(1000)); } + "quit" => { + bot.disconnect(); + tokio::time::sleep(Duration::from_millis(1000)).await; + std::process::exit(0); + } "inventory" => { println!("inventory: {:?}", bot.menu()); } -- cgit v1.2.3