aboutsummaryrefslogtreecommitdiff
path: root/sqlite.go
diff options
context:
space:
mode:
authorJan Mercl <0xjnml@gmail.com>2020-07-31 14:18:38 +0200
committerJan Mercl <0xjnml@gmail.com>2020-07-31 14:18:38 +0200
commit1349149922b282e74a77c7d51c316d883fba5b89 (patch)
tree6aef7056dbfe750984954ba25cbb97feb251d4cf /sqlite.go
parent3337c85b5e539021d90ccec9891d73b14c64671b (diff)
use crt v3.24.9
Diffstat (limited to 'sqlite.go')
-rw-r--r--sqlite.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/sqlite.go b/sqlite.go
index 7844001..b2a60b5 100644
--- a/sqlite.go
+++ b/sqlite.go
@@ -157,15 +157,15 @@ func init() {
panic(fmt.Errorf("cannot allocate memory"))
}
- *(*uintptr)(unsafe.Pointer(uintptr(varArgs))) = uintptr(unsafe.Pointer(&mutexMethods))
// int sqlite3_config(int, ...);
- if rc := sqlite3.Xsqlite3_config(tls, sqlite3.SQLITE_CONFIG_MUTEX, uintptr(varArgs)); rc != sqlite3.SQLITE_OK {
+ if rc := sqlite3.Xsqlite3_config(tls, sqlite3.SQLITE_CONFIG_MUTEX, crt.VaList(varArgs, uintptr(unsafe.Pointer(&mutexMethods)))); rc != sqlite3.SQLITE_OK {
p := sqlite3.Xsqlite3_errstr(tls, rc)
str := crt.GoString(p)
panic(fmt.Errorf("sqlite: failed to configure mutex methods: %v", str))
}
crt.Xfree(tls, varArgs)
+ tls.Close()
sql.Register(driverName, newDriver())
}