fixed multiple MIDI devices S/N

This commit is contained in:
2024-12-26 14:55:55 +01:00
9 changed files with 142 additions and 36 deletions

View File

@@ -152,11 +152,11 @@ func (h *HardwareManager) Scan(ctx context.Context) error {
return fmt.Errorf("No peripherals driver registered")
}
for _, driver := range h.drivers {
finder := driver
driverCopy := driver
go func() {
err := driver.Scan(ctx)
err := driverCopy.Scan(ctx)
if err != nil {
fmt.Printf("Unable to scan peripherals with the %s driver: %s\n", finder.GetName(), err)
fmt.Printf("Unable to scan peripherals with the %s driver: %s\n", driverCopy.GetName(), err)
return
}
}()