fixed closing of caches
parent
ecd5541c1e
commit
03d96b5aae
|
@ -39,6 +39,10 @@ func (c *OSMCache) Close() {
|
||||||
c.Relations.Close()
|
c.Relations.Close()
|
||||||
c.Relations = nil
|
c.Relations = nil
|
||||||
}
|
}
|
||||||
|
if c.InsertedWays != nil {
|
||||||
|
c.InsertedWays.Close()
|
||||||
|
c.InsertedWays = nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewOSMCache(dir string) *OSMCache {
|
func NewOSMCache(dir string) *OSMCache {
|
||||||
|
@ -172,8 +176,12 @@ func idFromKeyBuf(buf []byte) int64 {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Cache) Close() {
|
func (c *Cache) Close() {
|
||||||
|
if c.db != nil {
|
||||||
c.db.Close()
|
c.db.Close()
|
||||||
|
c.db = nil
|
||||||
|
}
|
||||||
if c.cache != nil {
|
if c.cache != nil {
|
||||||
c.cache.Close()
|
c.cache.Close()
|
||||||
|
c.cache = nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -227,9 +227,7 @@ func main() {
|
||||||
|
|
||||||
// blocks till the Nodes.Iter() finishes
|
// blocks till the Nodes.Iter() finishes
|
||||||
nodeWriter.Close()
|
nodeWriter.Close()
|
||||||
osmCache.Nodes.Close()
|
osmCache.Close()
|
||||||
osmCache.Coords.Close()
|
|
||||||
osmCache.Coords.SetReadOnly(false)
|
|
||||||
|
|
||||||
err = db.End()
|
err = db.End()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue