extern GList *found_group_list;
extern GList *found_device_list;
+extern GList *found_invited_device_list;
extern mdg_h handle;
#define CASE_TO_STR(x) case x: return #x;
g_list_free_full(found_group_list, _free_group);
if (found_device_list)
g_list_free_full(found_device_list, _free_device);
+ if (found_invited_device_list)
+ g_list_free_full(found_invited_device_list, _free_device);
mdg_deinitialize(handle);
}
if (is_exist == FALSE) {
- found_device_list = g_list_append(found_device_list, device);
+ mdg_device_h cloned_device;
+ mdg_device_info_clone(&cloned_device, device);
+ found_device_list = g_list_append(found_device_list, cloned_device);
msgp("\r[ID] %s [Type] %s [Name] %s", device_id,
__device_type_to_string(device_type), model_name);
}
bool _group_found_cb(mdg_group_type_e type, mdg_group_h group, void *user_data)
{
char *group_name;
+ mdg_group_h cloned_group;
mdg_group_info_get_name(group, &group_name);
else
msgp("\rfound group type : REMOTE, name : %s", group_name);
- found_group_list = g_list_append(found_group_list, group);
+ mdg_group_info_clone(&cloned_group, group);
+
+ found_group_list = g_list_append(found_group_list, cloned_group);
if (group_name != NULL)
free(group_name);
{
char *device_id = NULL;
mdg_device_type_e device_type;
+ mdg_device_h cloned_device;
mdg_device_info_get_device_id(device, &device_id);
mdg_device_info_get_type(device, &device_type);
if (device_id)
free(device_id);
- found_invited_device_list = g_list_append(found_invited_device_list, device);
+ mdg_device_info_clone(&cloned_device, device);
+
+ found_invited_device_list = g_list_append(found_invited_device_list, cloned_device);
return TRUE;
}