aboutsummaryrefslogblamecommitdiffstats
path: root/libgamepad_close_superdevice.c
blob: dc212bded89fa4faa1df782951bf7642c2966dff (plain) (tree)



















                                                                                
/* 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);
	}
}