mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-03-23 22:15:05 +00:00
Fix memory leak of children for combined JoyCon
This commit is contained in:
parent
602b7dd0f4
commit
42b2320756
|
@ -706,6 +706,7 @@ HIDAPI_DelDevice(SDL_HIDAPI_Device *device)
|
||||||
SDL_free(device->serial);
|
SDL_free(device->serial);
|
||||||
SDL_free(device->name);
|
SDL_free(device->name);
|
||||||
SDL_free(device->path);
|
SDL_free(device->path);
|
||||||
|
SDL_free(device->children);
|
||||||
SDL_free(device);
|
SDL_free(device);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -761,6 +762,9 @@ HIDAPI_CreateCombinedJoyCons()
|
||||||
if (combined && combined->driver) {
|
if (combined && combined->driver) {
|
||||||
return SDL_TRUE;
|
return SDL_TRUE;
|
||||||
} else {
|
} else {
|
||||||
|
if (!combined) {
|
||||||
|
SDL_free(children);
|
||||||
|
}
|
||||||
return SDL_FALSE;
|
return SDL_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue