Fixed memory leak in XInput code

Fixes https://github.com/libsdl-org/SDL/issues/3597
main
Sam Lantinga 2023-11-06 00:40:19 -08:00
parent bc3d9e99f3
commit 3e4d7e48b0
1 changed files with 6 additions and 0 deletions

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();
}