cmd/torrent/main.go | 4 ++-- diff --git a/cmd/torrent/main.go b/cmd/torrent/main.go index a04eb5eabb341125811d8bf91a7a0006630a4ee2..02020e77b30a8feebba5135308dcd7bb55f603b1 100644 --- a/cmd/torrent/main.go +++ b/cmd/torrent/main.go @@ -15,6 +15,7 @@ "syscall" "time" "github.com/alexflint/go-arg" + "github.com/anacrolix/envpprof" "github.com/anacrolix/missinggo" "github.com/anacrolix/torrent/bencode" "github.com/davecgh/go-spew/spew" @@ -23,7 +24,6 @@ "golang.org/x/xerrors" "github.com/anacrolix/log" - "github.com/anacrolix/envpprof" "github.com/anacrolix/tagflag" "golang.org/x/time/rate" @@ -223,6 +223,7 @@ } } func main() { + defer envpprof.Stop() if err := mainErr(); err != nil { log.Printf("error in main: %v", err) os.Exit(1) @@ -273,7 +274,6 @@ } } func downloadErr() error { - defer envpprof.Stop() clientConfig := torrent.NewDefaultClientConfig() clientConfig.DisableWebseeds = flags.DisableWebseeds clientConfig.DisableTCP = !flags.TcpPeers