Skip to content

Commit

Permalink
refactor(plugin): use drop on task await
Browse files Browse the repository at this point in the history
  • Loading branch information
SkuldNorniern committed Mar 13, 2024
1 parent cbe6a6f commit 9b8d3c4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fluere-plugin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ impl PluginManager {

pub async fn await_completion(&self, target_worker: Arc<Mutex<tokio::task::JoinHandle<()>>>) {
let worker_clone = target_worker.clone();
let _ = worker_clone.lock().await;
let worker = worker_clone.lock().await;

// Cleanup each plugin before exiting
let lua_clone = self.lua.clone();
Expand All @@ -326,5 +326,9 @@ impl PluginManager {
println!("cleanup function not found in plugin: {}", plugin_name);
}
}

drop(lua);
drop(plugins);
drop(worker);
}
}

0 comments on commit 9b8d3c4

Please sign in to comment.