We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dbd23f9 commit f8a5bd3Copy full SHA for f8a5bd3
1 file changed
src/pool.rs
@@ -1,5 +1,6 @@
1
//! A simple connection pool
2
3
+use std::cell::RefCell;
4
use sync::MutexArc;
5
6
use {PostgresNotifications,
@@ -109,8 +110,9 @@ pub struct PooledPostgresConnection {
109
110
impl Drop for PooledPostgresConnection {
111
fn drop(&mut self) {
112
unsafe {
113
+ let conn = RefCell::new(self.conn.take());
114
self.pool.pool.unsafe_access(|pool| {
- pool.pool.push(self.conn.take_unwrap());
115
+ pool.pool.push(conn.with_mut(|r| r.take_unwrap()));
116
})
117
}
118
0 commit comments