From 34f6449bd65244bafe770251a137dbc78be1c287 Mon Sep 17 00:00:00 2001 From: arthurprs Date: Sat, 9 May 2020 12:05:35 +0200 Subject: [PATCH] Reap connections on Pool drop --- src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index c9bda5ac..a6834d41 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -550,6 +550,14 @@ where } } +impl Drop for Pool +where + M: ManageConnection, +{ + fn drop(&mut self) { + reap_connections(&Arc::downgrade(&self.0)); + } +} /// The error type returned by methods in this crate. #[derive(Debug)] pub struct Error(Option);