db: fix another sqlite3 finalization bug

This commit is contained in:
Ryan Culpepper 2012-10-30 12:32:31 -04:00
parent 9773d89a44
commit 203a7a660c
2 changed files with 6 additions and 3 deletions

View File

@ -206,7 +206,7 @@
(let loop ()
(let ([stmt (sqlite3_next_stmt db #f)])
(when stmt
(HANDLE 'disconnect (sqlite3_finalize stmt))
(sqlite3_finalize stmt)
(loop))))
(HANDLE 'disconnect (sqlite3_close db))
(void))))))
@ -225,7 +225,7 @@
(let ([stmt (send pst get-handle)])
(send pst set-handle #f)
(when (and stmt -db)
(HANDLE fsym (sqlite3_finalize stmt)))
(sqlite3_finalize stmt))
(void)))))
;; Internal query

View File

@ -58,7 +58,10 @@
(define-sqlite sqlite3_finalize
(_fun _sqlite3_statement
-> _int))
-> _int
;; sqlite3_finalize returns error code of last stmt execution,
;; not of finalization; so just ignore
-> (void)))
(define-sqlite sqlite3_bind_parameter_count
(_fun _sqlite3_statement