Commit 88c3422c authored by gwenn's avatar gwenn

Ensures sqlite3_close/finalize are called only once.

parent 0b10a6cd
......@@ -507,11 +507,11 @@ func (c *Conn) Close() error {
}
rv := C.sqlite3_close(c.db)
c.db = nil
if rv != C.SQLITE_OK {
Log(int(rv), "error while closing Conn")
return c.error(rv)
}
c.db = nil
return nil
}
......
......@@ -915,11 +915,11 @@ func (s *Stmt) finalize() error {
return errors.New("nil sqlite statement")
}
rv := C.sqlite3_finalize(s.stmt)
s.stmt = nil
if rv != C.SQLITE_OK {
Log(int(rv), "error while finalizing Stmt")
return s.error(rv)
}
s.stmt = nil
return nil
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment