mirror of
https://github.com/Alexey71/opera-proxy.git
synced 2026-05-14 06:30:59 +00:00
close resolvers properly
This commit is contained in:
@@ -210,6 +210,10 @@ func run() int {
|
||||
addrs, err := func() ([]netip.Addr, error) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), args.timeout)
|
||||
defer cancel()
|
||||
defer func() {
|
||||
resolver = nil
|
||||
}()
|
||||
defer resolver.Close()
|
||||
return resolver.LookupNetIP(ctx, "ip4", API_DOMAIN)
|
||||
}()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user