Fixed memory leak in XInput code

Fixes https://github.com/libsdl-org/SDL/issues/3597

(cherry picked from commit 3e4d7e48b0a87b2c1df26ad62c8152ba6c064024)
This commit is contained in:
Sam Lantinga 2023-11-06 00:40:19 -08:00
parent 64a7e75dd3
commit d5896f9010

View file

@ -552,6 +552,12 @@ void SDL_XINPUT_JoystickClose(SDL_Joystick *joystick)
void SDL_XINPUT_JoystickQuit(void)
{
int iuserid;
for (iuserid = 0; iuserid < XUSER_MAX_COUNT; ++iuserid) {
DelXInputDevice(iuserid);
}
if (s_bXInputEnabled) {
WIN_UnloadXInputDLL();
}