Set direct sqlite storage conn to nil on close
This might help catch the reason for SQLITE_MISUSE in getCapacity.
This commit is contained in:
parent
092dc74458
commit
8a65ef627d
|
@ -114,15 +114,19 @@ func (c *client) OpenTorrent(info *metainfo.Info, infoHash metainfo.Hash) (stora
|
|||
return storage.TorrentImpl{Piece: t.Piece, Close: t.Close, Capacity: &c.capacity}, nil
|
||||
}
|
||||
|
||||
func (c *client) Close() error {
|
||||
func (c *client) Close() (err error) {
|
||||
c.l.Lock()
|
||||
defer c.l.Unlock()
|
||||
c.flushBlobs()
|
||||
c.closed = true
|
||||
if c.opts.BlobFlushInterval != 0 {
|
||||
c.blobFlusher.Stop()
|
||||
}
|
||||
return c.conn.Close()
|
||||
if !c.closed {
|
||||
c.closed = true
|
||||
err = c.conn.Close()
|
||||
c.conn = nil
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type torrent struct {
|
||||
|
|
Loading…
Reference in New Issue