Added a cleanup function for virtual joysticks

This commit is contained in:
Sam Lantinga
2024-08-26 20:11:09 -07:00
parent 00c409cff8
commit 47926d7bd0
2 changed files with 5 additions and 0 deletions

View File

@@ -70,6 +70,10 @@ static void VIRTUAL_FreeHWData(joystick_hwdata *hwdata)
return;
}
if (hwdata->desc.Cleanup) {
hwdata->desc.Cleanup(hwdata->desc.userdata);
}
// Remove hwdata from SDL-global list
for (cur = g_VJoys; cur; prev = cur, cur = cur->next) {
if (hwdata == cur) {