about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPjotr Prins2025-12-19 11:40:15 +0100
committerPjotr Prins2025-12-19 11:40:15 +0100
commit18e04fc984b083bff1004200bbda8cb1cd72ae69 (patch)
treeed0a3d46136e19fb11c7cb1bc264ed51b564af6e
parent84d911233db8a159cd0620aa71feb39a71486648 (diff)
downloadgn-guile-main.tar.gz
Make sure to close DB HEAD main
-rw-r--r--gn/db/mysql.scm7
1 files changed, 4 insertions, 3 deletions
diff --git a/gn/db/mysql.scm b/gn/db/mysql.scm
index 623a726..8da7b60 100644
--- a/gn/db/mysql.scm
+++ b/gn/db/mysql.scm
@@ -37,9 +37,10 @@
     )))
 
 (define (call-with-db thunk)
-  (let [(db (db-open))]
-    (thunk db)
-    (dbi-close db)))
+  (let* [(db (db-open))
+         (result (thunk db))]
+    (dbi-close db)
+    result))
 
 (define (ensure db msg1)
   "Use DBI-style handle to report an error. On error the program will stop."