Skip to content

Commit

Permalink
Reap connections on Pool drop
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurprs committed May 9, 2020
1 parent 152ddc7 commit 34f6449
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,14 @@ where
}
}

impl<M> Drop for Pool<M>
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<String>);
Expand Down

0 comments on commit 34f6449

Please sign in to comment.