mirror of
https://github.com/aaru-dps/aaruremote.git
synced 2025-12-16 19:24:37 +00:00
Free device info list.
This commit is contained in:
@@ -82,5 +82,6 @@ typedef struct DeviceInfoList
|
||||
#pragma pack(pop)
|
||||
|
||||
DeviceInfoList* ListDevices();
|
||||
void FreeDeviceInfoList(DeviceInfoList* start);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -21,11 +21,26 @@
|
||||
#include "linux/linux.h"
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
DeviceInfoList* ListDevices()
|
||||
{
|
||||
#if defined(__linux__) && !defined(__ANDROID__)
|
||||
return linux_list_devices();
|
||||
#else
|
||||
return 0;
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
void FreeDeviceInfoList(DeviceInfoList* start)
|
||||
{
|
||||
DeviceInfoList* current;
|
||||
|
||||
while(start)
|
||||
{
|
||||
current = start;
|
||||
start = current->next;
|
||||
free(current);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user