diff options
author | Chris Hines <github@cs-guy.com> | 2016-04-06 20:38:51 -0400 |
---|---|---|
committer | Chris Hines <github@cs-guy.com> | 2016-04-07 10:21:00 -0400 |
commit | 5816124570dc91b548fb7039f5e07b2561e4cddf (patch) | |
tree | 9c502a469edfc3254c37b34cdfbbafaf68303d65 | |
parent | Merge pull request #546 from josephspurrier/master (diff) | |
download | dedo-5816124570dc91b548fb7039f5e07b2561e4cddf.tar.gz dedo-5816124570dc91b548fb7039f5e07b2561e4cddf.tar.xz |
Wait to clear db.path until just before db.close returns.
The Windows version of funlock needs the db.path to delete the
corresponding .lock file.
-rw-r--r-- | db.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -94,7 +94,7 @@ type DB struct { path string file *os.File lockfile *os.File // windows only - dataref []byte // mmap'ed readonly, write throws SEGV + dataref []byte // mmap'ed readonly, write throws SEGV data *[maxMapSize]byte datasz int filesz int // current on disk file size @@ -383,11 +383,10 @@ func (db *DB) close() error { if !db.opened { return nil } - + db.opened = false db.freelist = nil - db.path = "" // Clear ops. db.ops.writeAt = nil @@ -414,6 +413,7 @@ func (db *DB) close() error { db.file = nil } + db.path = "" return nil } |