My robot OI uses an XboxController, and to access the buttons, I use code like this:
As you can see, the code is underlined with a “Resource leak” warning. I know this means I’m supposed to close the resource, but since the buttons are used throughout the lifespan of the program, I’m not sure where to close the buttons in my code. I’m fairly confident this is not a vscode error; I’ve cleaned the java workspace and recompiled multiple times. For some reason, this doesn’t show up in some other code which uses a JoystickController. Can someone help me out?