fix race condition triggered with new relation_members handling

master
Oliver Tonnhofer 2016-01-06 08:46:06 +01:00
parent 7a7314bfb5
commit b25774d891
1 changed files with 2 additions and 1 deletions

3
cache/delta.go vendored
View File

@ -28,7 +28,8 @@ func (b *coordsBunch) GetCoord(id int64) (*element.Node, error) {
return b.coords[i].Id >= id
})
if idx < len(b.coords) && b.coords[idx].Id == id {
return &b.coords[idx], nil
nd := b.coords[idx] // create copy prevent to race when node gets reprojected
return &nd, nil
}
return nil, NotFound
}