static wifi_ap_object *_create_ap_object_by_ap_h(wifi_ap_h ap)
{
wifi_ap_object *ap_obj = g_new0(wifi_ap_object, 1);
- gboolean is_create_failed = FALSE;
- if (!ap_obj) {
+ if (!ap_obj)
return NULL;
- }
+
if (WIFI_ERROR_NONE != wifi_ap_clone(&(ap_obj->ap), ap)) {
- is_create_failed = TRUE;
- } else if (WIFI_ERROR_NONE != wifi_ap_get_rssi(ap, &(ap_obj->rssi))) {
- is_create_failed = TRUE;
- } else if (WIFI_ERROR_NONE != wifi_ap_is_wps_supported(ap, &(ap_obj->wps_mode))) {
- is_create_failed = TRUE;
+ WIFI_LOG_ERR("Failed to clone AP handle");
+ g_free(ap_obj);
+ return NULL;
+ }
+
+ if (WIFI_ERROR_NONE != wifi_ap_get_rssi(ap, &(ap_obj->rssi))) {
+ WIFI_LOG_ERR("Failed to get rssi of AP");
+ wifi_manager_ap_destroy(ap_obj);
+ return NULL;
}
- if (is_create_failed) {
+ if (WIFI_ERROR_NONE != wifi_ap_is_wps_supported(ap, &(ap_obj->wps_mode))) {
+ WIFI_LOG_ERR("Failed to get wps mode of AP");
wifi_manager_ap_destroy(ap_obj);
return NULL;
}
+
ap_obj->last_connection_error = WIFI_ERROR_NONE;
ap_obj->is_captiveportal = FALSE;
return ap_obj;
guint index, old_items_count = elm_genlist_items_count(self->ap_list) - 1;
guint new_items_count = g_list_length(self->ap_data_list);
Elm_Genlist_Item_Class *wifi_ap_itc = _create_wifi_ap_itc(self);
+ Elm_Object_Item *ap_item = NULL;
__WIFI_FUNC_ENTER__;
WIFI_RET_VAL_IF_FAIL(wifi_ap_itc != NULL, FALSE);
if (new_items_count < old_items_count) {
guint rm_index;
for (rm_index = old_items_count; rm_index > new_items_count; rm_index--) {
- elm_object_item_del(elm_genlist_nth_item_get(self->ap_list, rm_index));
+ ap_item = elm_genlist_nth_item_get(self->ap_list, rm_index);
+ if (ap_item)
+ elm_object_item_del(ap_item);
}
}
for (index = 1; l != NULL; index++, l = l->next) {