Fix memory leak in query node

Signed-off-by: xige-16 <xi.ge@zilliz.com>
This commit is contained in:
xige-16 2020-12-04 19:32:30 +08:00 committed by yefu.chen
parent 18a9ffb617
commit acdf8cc9e1

View File

@ -111,6 +111,7 @@ func (colReplica *collectionReplicaImpl) removeCollection(collectionID UniqueID)
if col.ID() == collectionID { if col.ID() == collectionID {
for _, p := range *col.Partitions() { for _, p := range *col.Partitions() {
for _, s := range *p.Segments() { for _, s := range *p.Segments() {
deleteSegment(colReplica.segments[s.ID()])
delete(colReplica.segments, s.ID()) delete(colReplica.segments, s.ID())
} }
} }
@ -202,6 +203,7 @@ func (colReplica *collectionReplicaImpl) removePartition(collectionID UniqueID,
for _, p := range *collection.Partitions() { for _, p := range *collection.Partitions() {
if p.Tag() == partitionTag { if p.Tag() == partitionTag {
for _, s := range *p.Segments() { for _, s := range *p.Segments() {
deleteSegment(colReplica.segments[s.ID()])
delete(colReplica.segments, s.ID()) delete(colReplica.segments, s.ID())
} }
} else { } else {