diff --git a/Cargo.toml b/Cargo.toml index 916aa8eaa..cb652fe4c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -61,7 +61,7 @@ pretty_env_logger = { version = "0.4", optional = true } quick-xml = "0.27" rand = "0.8" regex = "1.7" -rusqlite = { version = "0.28", features = ["sqlcipher"] } +rusqlite = { version = "0.28", features = ["sqlcipher", "release_memory"] } rust-hsluv = "0.1" sanitize-filename = "0.4" serde_json = "1.0" diff --git a/src/sql/pool.rs b/src/sql/pool.rs index 477b7d57f..63d0746ae 100644 --- a/src/sql/pool.rs +++ b/src/sql/pool.rs @@ -44,6 +44,7 @@ impl Drop for PooledConnection { // Put the connection back unless the pool is already dropped. if let Some(pool) = self.pool.upgrade() { if let Some(conn) = self.conn.take() { + conn.release_memory().ok(); pool.put(conn); } }