Skip to content

Commit

Permalink
Add error message for double-close
Browse files Browse the repository at this point in the history
Fixes #101
  • Loading branch information
zombiezen committed May 24, 2024
1 parent a8ad27a commit 3255b67
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

[Unreleased]: https://github.com/zombiezen/go-sqlite/compare/v1.3.0...main

## [Unreleased][]

### Changed

- `Conn.Close` returns an error if the connection has already been closed
([#101](https://github.com/zombiezen/go-sqlite/issues/101)).

## [1.3.0][] - 2024-05-04

Version 1.3 is largely a bug-fix release,
Expand Down
3 changes: 3 additions & 0 deletions sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ func (c *Conn) Close() error {
if c == nil {
return fmt.Errorf("sqlite: close: nil connection")
}
if c.closed {
return fmt.Errorf("sqlite: close: already closed")
}
c.cancelInterrupt()
c.closed = true
for _, stmt := range c.stmts {
Expand Down

0 comments on commit 3255b67

Please sign in to comment.