sql: release memory when returning connection to the pool

This commit is contained in:
link2xt
2023-02-17 22:09:24 +00:00
parent bfd3c1763d
commit 90087bde39
2 changed files with 2 additions and 1 deletions

View File

@@ -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"

View File

@@ -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);
}
}