cmd/torrent: Ensure envpprof.Stop runs before exit

This commit is contained in:
Matt Joiner 2021-10-07 17:00:39 +11:00
parent 15a2d3fb23
commit 4d496bf756
1 changed files with 1 additions and 1 deletions

View File

@ -209,7 +209,6 @@ func exitSignalHandlers(notify *missinggo.SynchronizedEvent) {
}
func main() {
defer envpprof.Stop()
if err := mainErr(); err != nil {
log.Printf("error in main: %v", err)
os.Exit(1)
@ -217,6 +216,7 @@ func main() {
}
func mainErr() error {
defer envpprof.Stop()
stdLog.SetFlags(stdLog.Flags() | stdLog.Lshortfile)
debug := args.Flag(args.FlagOpt{Long: "debug"})
p := args.ParseMain(