diff options
Diffstat (limited to 'libgamepad_close_superdevice.c')
-rw-r--r-- | libgamepad_close_superdevice.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libgamepad_close_superdevice.c b/libgamepad_close_superdevice.c new file mode 100644 index 0000000..dc212bd --- /dev/null +++ b/libgamepad_close_superdevice.c @@ -0,0 +1,20 @@ +/* See LICENSE file for copyright and license details. */ +#include "common.h" + + +void +libgamepad_close_superdevice(struct libgamepad_superdevice *device) +{ + if (device) { + free(device->syspath); + while (device->ndevices) + free(device->devices[--device->ndevices]); + free(device->devices); + while (device->nleds) + free(device->leds[--device->nleds]); + free(device->leds); + while (device->npower_supplies) + free(device->power_supplies[--device->npower_supplies]); + free(device->power_supplies); + } +} |