Fix crash when removing controllers
Fixes
import java.util.Map;
import java.util.Queue;
import java.util.Set;
+import java.util.concurrent.CopyOnWriteArrayList;
/**
* Retrieves information on connected controllers through JInput.
.build();
private ControllerConfig config;
- private final List<Controller> controllers = new ArrayList<>();
+ /* MUST be a CopyOnWriteArrayList! Or else you just get crashes when unplugging controllers. */
+ private final List<Controller> controllers = new CopyOnWriteArrayList<>();
public JInputControllerDevice(ControllerConfig config) {
this.config = config;
