about summary refs log tree commit diff
path: root/gn
diff options
context:
space:
mode:
Diffstat (limited to 'gn')
-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."