fix memory leak of grpc resolver (#4490)

Co-authored-by: nk <kui.niu@akuvox.com>
This commit is contained in:
saury
2025-01-22 13:36:13 +08:00
committed by GitHub
parent b650c8c425
commit 17d98f69e0
6 changed files with 86 additions and 16 deletions

View File

@@ -38,7 +38,7 @@ func (b *discovBuilder) Build(target resolver.Target, cc resolver.ClientConn, _
sub.AddListener(update)
update()
return &nopResolver{cc: cc}, nil
return &nopResolver{cc: cc, closeFunc: func() { sub.Close() }}, nil
}
func (b *discovBuilder) Scheme() string {