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)
|
#pragma pack(pop)
|
||||||
|
|
||||||
DeviceInfoList* ListDevices();
|
DeviceInfoList* ListDevices();
|
||||||
|
void FreeDeviceInfoList(DeviceInfoList* start);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -21,11 +21,26 @@
|
|||||||
#include "linux/linux.h"
|
#include "linux/linux.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
DeviceInfoList* ListDevices()
|
DeviceInfoList* ListDevices()
|
||||||
{
|
{
|
||||||
#if defined(__linux__) && !defined(__ANDROID__)
|
#if defined(__linux__) && !defined(__ANDROID__)
|
||||||
return linux_list_devices();
|
return linux_list_devices();
|
||||||
#else
|
#else
|
||||||
return 0;
|
return NULL;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void FreeDeviceInfoList(DeviceInfoList* start)
|
||||||
|
{
|
||||||
|
DeviceInfoList* current;
|
||||||
|
|
||||||
|
while(start)
|
||||||
|
{
|
||||||
|
current = start;
|
||||||
|
start = current->next;
|
||||||
|
free(current);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
2
main.c
2
main.c
@@ -317,6 +317,8 @@ int main()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FreeDeviceInfoList(deviceInfoList);
|
||||||
|
|
||||||
printf("List devices not yet implemented, skipping...\n");
|
printf("List devices not yet implemented, skipping...\n");
|
||||||
continue;
|
continue;
|
||||||
case DICMOTE_PACKET_TYPE_RESPONSE_LIST_DEVICES:
|
case DICMOTE_PACKET_TYPE_RESPONSE_LIST_DEVICES:
|
||||||
|
|||||||
Reference in New Issue
Block a user