Selaa lähdekoodia

Fix check config

世界 2 vuotta sitten
vanhempi
sitoutus
45852ca3e7
1 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  1. 4 1
      cmd/sing-box/cmd_check.go

+ 4 - 1
cmd/sing-box/cmd_check.go

@@ -31,7 +31,10 @@ func check() error {
 		return err
 	}
 	ctx, cancel := context.WithCancel(context.Background())
-	_, err = box.New(ctx, options, nil)
+	instance, err := box.New(ctx, options, nil)
+	if err == nil {
+		instance.Close()
+	}
 	cancel()
 	return err
 }