about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPjotr Prins2025-12-19 11:36:15 +0100
committerPjotr Prins2025-12-19 11:36:15 +0100
commit84d911233db8a159cd0620aa71feb39a71486648 (patch)
tree36b43ea37221d6dfdfb2632b860964a2fc4f4f10
parent0b66da373e049c3fcd4d6756a8aa2d3894f273ef (diff)
downloadgn-guile-84d911233db8a159cd0620aa71feb39a71486648.tar.gz
Make sure to close DB
-rw-r--r--gn/db/mysql.scm4
1 files changed, 3 insertions, 1 deletions
diff --git a/gn/db/mysql.scm b/gn/db/mysql.scm
index 223b5fd..623a726 100644
--- a/gn/db/mysql.scm
+++ b/gn/db/mysql.scm
@@ -37,7 +37,9 @@
     )))
 
 (define (call-with-db thunk)
-  (thunk (db-open)))
+  (let [(db (db-open))]
+    (thunk db)
+    (dbi-close db)))
 
 (define (ensure db msg1)
   "Use DBI-style handle to report an error. On error the program will stop."