cmd/torrent: Ensure envpprof.Stop runs before exit
This commit is contained in:
parent
15a2d3fb23
commit
4d496bf756
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue