SDL: Fixed controllers not being seen as gamepads after adding a mapping

From 421326b6dae6f1a418016c270d47f85152e1bc28 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 19 Jun 2024 08:32:18 -0700
Subject: [PATCH] Fixed controllers not being seen as gamepads after adding a
 mapping

---
 src/joystick/SDL_gamepad.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/joystick/SDL_gamepad.c b/src/joystick/SDL_gamepad.c
index 1a2516f9a715d..833cfae42ec0d 100644
--- a/src/joystick/SDL_gamepad.c
+++ b/src/joystick/SDL_gamepad.c
@@ -563,6 +563,7 @@ static void PopMappingChangeTracking(void)
             GamepadMapping_t *old_mapping = gamepad ? gamepad->mapping : tracker->joystick_mappings[i];
 
             if (new_mapping && !old_mapping) {
+                SDL_RemoveFromHashTable(s_gamepadInstanceIDs, (void *)(uintptr_t)joystick);
                 SDL_InsertIntoHashTable(s_gamepadInstanceIDs, (void *)(uintptr_t)joystick, (const void *)SDL_TRUE);
                 SDL_PrivateGamepadAdded(joystick);
             } else if (old_mapping && !new_mapping) {