{
device_type = DEVICE_WEARABLE_360_X_480;
}
- else if(width == 320 && height == 320)
- {
- device_type = DEVICE_WEARABLE_320_320;
- }
else
{
device_type = DEVICE_WEARABLE_320_320;
itc->func.del = _gl_del_cb;
item_data *id = calloc(sizeof(item_data), 1);
+ RETVM_IF(id == NULL,NULL,"id is null");
id->index = index++;
id->text = strdup(item_text);
} \
}
+#define RETM_IF_CLEANUP(expr, fmt, FreeResource, arg...) \
+{ \
+ if (expr) \
+ { \
+ ERR(fmt, ##arg); \
+ FreeResource; \
+ return; \
+ } \
+}
+
+
+#define RETVM_IF_CLEANUP(expr, val, fmt, FreeResource, arg...) \
+{ \
+ if (expr) \
+ { \
+ ERR(fmt, ##arg); \
+ FreeResource; \
+ return (val); \
+ } \
+}
+
+
#define SAFE_DELETE(a) if( (a) != NULL ) free (a); (a) = NULL;
#endif /* __LOGGER_H__ */
this->video_player_data = (videoplayer_data_s*) malloc(sizeof(videoplayer_data_s));
+ RETM_IF( this->video_player_data == NULL,"data pointer is null");
//this->video_player_data->video_rect = this->video_rect;
this->video_player_data->bg = NULL;
this->video_player_data->rect = NULL;
appdata_s *this = (appdata_s*) data;
this->sound_player_data = (soundplayer_data_s*) malloc(sizeof(soundplayer_data_s));
+ RETM_IF( this->sound_player_data == NULL,"data pointer is null");
+
this->sound_player_data->uri = this->uri;
this->sound_player_data->player = create_sound_player(this->sound_player_data);
this->list = eina_list_append(this->list, attr);
ret = ime_update_preedit_string("abcd", this->list);
- RETM_IF(IME_ERROR_NONE!=ret, "ime_update_preedit_string fails :%s",_get_ime_error(ret));
if (ret != IME_ERROR_NONE)
{
EINA_LIST_FREE(this->list, attr)
SAFE_DELETE(attr);
}
+ SAFE_DELETE(attr);
}
return (val); \
} \
}
+#define RETM_IF_ERROR(expr, fmt, arg...) \
+{ \
+ if (expr) \
+ { \
+ ERR(fmt, ##arg); \
+ return -1; \
+ } \
+}
#define SAFE_DELETE(a) if( (a) != NULL ) free (a); (a) = NULL;
{
int ret = 0;
app_control_h service = NULL;
- app_control_create(&service);
+ ret = app_control_create(&service);
if (service == NULL)
{
DBG("service_create failed!");
return 0;
}
+ if(ret != APP_CONTROL_ERROR_NONE)
+ {
+ DBG("App control create failure!");
+ return -1;
+ }
app_control_set_operation(service, "http://tizen.org/appcontrol/operation/setting/nfc");
app_control_add_extra_data(service, "type", "nfc");
ret = app_control_send_launch_request(service, NULL, NULL);
itc->func.del = _gl_del_cb;
item_data *id = calloc(sizeof(item_data), 1);
+ RETVM_IF(id == NULL,NULL,"id is null ");
+
id->index = index++;
id->text = strdup(item_text);
} \
}
+#define RETM_IF_CLEANUP(expr, fmt, FreeResource, arg...) \
+{ \
+ if (expr) \
+ { \
+ ERR(fmt, ##arg); \
+ FreeResource; \
+ return; \
+ } \
+}
+
+
#define RETVM_IF(expr, val, fmt, arg...) \
{ \
if (expr) \
} \
}
+#define RETVM_IF_CLEANUP(expr, val, fmt, FreeResource, arg...) \
+{ \
+ if (expr) \
+ { \
+ ERR(fmt, ##arg); \
+ FreeResource; \
+ return (val); \
+ } \
+}
+
#define SAFE_DELETE(a) if( (a) != NULL ) free (a); (a) = NULL;
#endif /* __LOGGER_H__ */
static void _app_terminate_cb(void *user_data)
{
app_data *ad = user_data;
+ char* edge_path=NULL;
RETM_IF(NULL == ad, "app is null");
if(_tbt_app_terminate_cb != NULL)
{
#ifdef DEVICE_TYPE_WEARABLE
if(get_device_type() == DEVICE_WEARABLE_360_360)
{
- elm_theme_overlay_del(NULL, get_edje_path("custom_button.edj"));
+ edge_path = get_edje_path("custom_button.edj");
+ elm_theme_overlay_del(NULL, edge_path);
}
+ SAFE_DELETE(edge_path);
#endif
win_destroy(ad->win);
ad->win = NULL;
{
char buf[MAX_LENGTH] = {'\0'};
snprintf(buf, MAX_LENGTH, "<font_size=%d>%s</font_size>",font_size, text);
- char *p = (char *)malloc(sizeof(buf));
+
+ char *p = NULL;
+ p = (char *)malloc(sizeof(buf));
+ RETVM_IF(NULL == p, NULL, "malloc is failed");
+
snprintf(p,strlen(buf), buf);
return p;
}
snprintf(buf, MAX_LENGTH, "<p align=center><font_size=%d>%s</font></p>", font_size, text);
}
- char *p = (char *)malloc(sizeof(buf));
+ char *p = NULL;
+ p = (char *)malloc(sizeof(buf));
+ RETVM_IF(NULL == p, NULL, "malloc is failed");
+
snprintf(p,strlen(buf), buf);
return p;
}
util_state_transition* transition = util_state_object_get_transition(from,feed_value);
if(transition==NULL)
{
- transition=malloc(sizeof(util_state_transition));
+ transition = malloc(sizeof(util_state_transition));
+ RETVM_IF(NULL == transition, NULL, "malloc is failed");
+
transition->destination=to;
transition->input=feed_value;
from->transitions = g_list_append(from->transitions,transition);
itc->func.del = bluetooth_gl_del_cb;
item_data *id = calloc(sizeof(item_data), 1);
+ RETVM_IF(NULL == id,NULL, "calloc failed for id return NULL");
+
id->index = index++;
id->text = strdup(item_text);
result = bt_opp_client_initialize();
RETM_IF(result != BT_ERROR_NONE, "bt_opp_client_initialize fail > Error = %d", result);
- result = bt_opp_client_add_file(get_shared_resource_path(this->view->tbt_info->file_name));
+ char *file_path = get_shared_resource_path(this->view->tbt_info->file_name);
+ result = bt_opp_client_add_file(file_path);
+ SAFE_DELETE(file_path);
RETM_IF(result != BT_ERROR_NONE, "bt_opp_client_add_file fail > Error = %d", result);
if(this->selected_device_info != NULL)
RETM_IF(NULL == view, "view is NULL");
#ifdef DEVICE_TYPE_WEARABLE
- if(get_device_type() == DEVICE_WEARABLE_320_320)
- {
- elm_theme_overlay_del(NULL, get_edje_path("custom_button.edj"));
- }
+ if(get_device_type() == DEVICE_WEARABLE_320_320)
+ {
+ char* edje_path = get_edje_path("custom_button.edj");
+ elm_theme_overlay_del(NULL, edje_path);
+ SAFE_DELETE(edje_path);
+ }
#endif
if(view->view->tbt_info->apptype == TBT_APP_BT_SERVER_PAIRED)
if(view->bt_player)
{
- player_stop(view->bt_player);
- player_unprepare(view->bt_player);
- player_destroy(view->bt_player);
+ result = player_stop(view->bt_player);
+ if(result != PLAYER_ERROR_NONE)
+ {
+ DBG("[player_stop] Failed.");
+ }
+ result = player_unprepare(view->bt_player);
+ if(result != PLAYER_ERROR_NONE)
+ {
+ DBG("[player_unprepare] Failed.");
+ }
+ result = player_destroy(view->bt_player);
+ if(result != PLAYER_ERROR_NONE)
+ {
+ DBG("[player_destroy] Failed.");
+ }
view->bt_player = NULL;
}
SAFE_DELETE(view->view);
SAFE_DELETE(view);
-
-
}
char* svc_uuid;
char* str;
- bt_gatt_get_uuid(service_handle, &svc_uuid);
+ int ret = bt_gatt_get_uuid(service_handle, &svc_uuid);
+ RETM_IF(ret != BT_ERROR_NONE, "bt_gatt_get_uuid fail > Error = %s", get_bluetooth_error(ret));
str = format_string("Service UUID: %s",svc_uuid);
RETVM_IF(NULL == file_name,NULL, "file_name is NULL");
FILE *f = fopen(file_name, "w");
- RETVM_IF(NULL == f, NULL, "fopen fail > File = %s", file_name);
+ RETVM_IF_CLEANUP(NULL == f, NULL, "fopen fail > File = %s",file_name; SAFE_DELETE(file_name));
unsigned size = image->size;
unsigned char *data = image->data;
{
if (view->file_path != NULL)
{
- remove(view->file_path);
SAFE_DELETE(view->file_path);
}
for (i = 0; i < count; i++)
{
- draw_lines(faces[i].x, faces[i].y, faces[i].width, faces[i].height, i, view);
+ draw_lines(faces[i].x, faces[i].y, faces[i].height, faces[i].width, i, view);
}
}
file_path = get_resource_path("images/pass.png");
image = ui_utils_create_image(parent, file_path);
eext_more_option_item_part_content_set(item, "item,icon", image);
+ SAFE_DELETE(file_path);
item = eext_more_option_item_append(parent);
eext_more_option_item_part_text_set(item, "selector,main_text", "Fail");
file_path = get_resource_path("images/fail.png");
image = ui_utils_create_image(parent, file_path);
eext_more_option_item_part_content_set(item, "item,icon", image);
+ SAFE_DELETE(file_path);
item = eext_more_option_item_append(parent);
eext_more_option_item_part_text_set(item, "selector,main_text", "Info");
file_path = get_resource_path("images/info.png");
image = ui_utils_create_image(parent, file_path);
eext_more_option_item_part_content_set(item, "item,icon", image);
-
+
+ SAFE_DELETE(file_path);
evas_object_smart_callback_add(parent, "more,option,opened", _more_option_opened, NULL);
evas_object_smart_callback_add(parent, "more,option,closed", _more_option_closed, NULL);
sprintf(resultc, "Total call and messages made to Test is = %d", usage_count);
ui_utils_label_set_text(this->info_label, resultc, "left");
-
- break;
}
elm_object_part_content_set(this->view->layout, "info_text", this->info_label);
itc->func.del = _gl_del_cb;
item_data *id = calloc(sizeof(item_data), 1);
+ RETVM_IF(NULL == id, NULL, "calloc fails id is null");
+
id->index = index++;
id->text = strdup(item_text);
RETVM_IF(NULL == navi, NULL, "navi is null");
this = calloc(1, sizeof(datacontrol_view));
+ RETVM_IF(this==NULL, NULL, "calloc failed");
this->view = calloc(1, sizeof(common_view));
- RETVM_IF(!this->view, NULL, "calloc failed");
+ RETVM_IF(this->view==NULL, NULL, "calloc failed");
this->data_inserted_flag = 0;
this->row_count = MAX_LENGTH;
#ifdef DEVICE_TYPE_WEARABLE
if(get_device_type() == DEVICE_WEARABLE_320_320 || (get_device_type() == DEVICE_WEARABLE_360_360))
{
- elm_theme_overlay_del(NULL, get_edje_path("custom_button.edj"));
+ char* edjefilePath = get_edje_path("custom_button.edj");
+ elm_theme_overlay_del(NULL,edjefilePath);
+ SAFE_DELETE(edjefilePath);
}
+
#endif
data_control_destroy(this);
itc->func.del = _gl_del_cb;
item_data *id = calloc(sizeof(item_data), 1);
+ RETVM_IF(id==NULL, NULL, "calloc failed id is NULL");
+
id->index = index++;
id->text = strdup(item_text);
file_path = get_resource_path(this->view->tbt_info->file_name);
this->image = ui_utils_create_image(this->view->layout, file_path);
- RETVM_IF(NULL == this->image, false, "create of layout elements failed");
+ RETVM_IF_CLEANUP(NULL == this->image, false, "create of layout elements failed", SAFE_DELETE(file_path));
if(EINA_TRUE == elm_image_animated_available_get(this->image))
{
elm_object_part_content_set(this->view->layout, "1cnt", this->image);
- //int x,y,w,h;
evas_object_geometry_get(this->image, &x, &y, &w, &h);
DBG("Dim: %d %d %d %d", x, y, w, h);
+ SAFE_DELETE(file_path);
return this;
}
player_h player = NULL;
int result = player_create(&player);
+ char* file_name=NULL;
if(result == PLAYER_ERROR_NONE)
{
result = player_set_sound_type(player, SOUND_TYPE_MEDIA);
RETVM_IF(result != PLAYER_ERROR_NONE, NULL, "player_set_volume fail > Error = %s", get_local_view_error(result));
result = player_set_looping(player, true);
RETVM_IF(result != PLAYER_ERROR_NONE, NULL, "player_set_looping fail > Error = %s", get_local_view_error(result));
- result = player_set_uri(player, get_resource_path(this->view->tbt_info->file_name));
+ file_name=get_resource_path(this->view->tbt_info->file_name);
+ result = player_set_uri(player, file_name);
+ SAFE_DELETE(file_name);
+
RETVM_IF(result != PLAYER_ERROR_NONE, NULL, "player_set_uri fail > Error = %s", get_local_view_error(result));
#ifdef DEVICE_TYPE_MOBILE
result = player_set_display(player, PLAYER_DISPLAY_TYPE_EVAS, GET_DISPLAY(this->video_rect));
{
ERR("player_pause fail > Error = %s", get_local_view_error(result));
}
-
return player;
}
elm_object_part_content_set(this->view->layout, "activity_text", this->activity_label);
ui_utils_label_set_text(this->activity_label, "Activity Status", "left");
- const char *file_path;
+
+ char *file_path;
file_path = get_resource_path(this->view->tbt_info->file_name);
this->activity_image = ui_utils_create_image(this->view->layout, file_path);
evas_object_geometry_get(this->activity_image, &x, &y, &w, &h);
DBG("Dim: %d %d %d %d", x, y, w, h);
- RETVM_IF(NULL == this->activity_image, false, "creation of layout elements failed");
+ RETVM_IF_CLEANUP(NULL == this->activity_image, false, "creation of layout elements failed",SAFE_DELETE(file_path));
elm_object_part_content_set(this->view->layout, "activity_image", this->activity_image);
Evas_Object *control = add_control_layout(this, this->view->layout);
elm_object_part_content_set(this->view->layout, "controlr_part", control);
evas_object_show(control);
+ SAFE_DELETE(file_path);
+
return this;
}
elm_naviframe_item_pop(this->view->navi);
activity_stop_recognition(this->handle);
activity_release(this->handle);
- RETM_IF(nRet != ACTIVITY_ERROR_NONE, "activity_start_recognition failed for activity type = %s",_motion_get_activity_type(activity_type));
+ char * error_string = _motion_get_activity_type(activity_type);
+ DBG("activity_start_recognition failed for activity type = %s", error_string);
+ SAFE_DELETE(error_string);
}
}
DBG("activity_recognition_callback_check_type");
RETM_IF(NULL == user_data, "User data is NULL");
motion_detection_view *this = (motion_detection_view*)user_data;
- snprintf(label, sizeof(label), "%s : %s" , "Activity Status is : ", _motion_get_activity_type(activity));
+
+ char * error_string = _motion_get_activity_type(activity);
+
+ snprintf(label, sizeof(label), "%s : %s" , "Activity Status is : ", error_string);
+ SAFE_DELETE(error_string);
+
ui_utils_label_set_text(this->activity_label, label, "left");
return;
}
*/
int nfc_onoff_operation(void)
{
- int ret = 0;
+ int ret = -1;
+
app_control_h service = NULL;
- app_control_create(&service);
+ ret = app_control_create(&service);
+
+ if(ret == -1)
+ {
+ DBG("service_create failed!");
+ return -1;
+ }
if (service == NULL)
{
DBG("service_create failed!");
- return 0;
+ return -1;
}
+
app_control_set_operation(service, "http://tizen.org/appcontrol/operation/setting/nfc");
app_control_add_extra_data(service, "type", "nfc");
ret = app_control_send_launch_request(service, NULL, NULL);
itc->func.del = _gl_del_cb;
item_data *id = calloc(sizeof(item_data), 1);
+ RETVM_IF(NULL == id, NULL, "calloc failed");
+
id->index = index++;
id->text = strdup(item_text);
res = dnssd_service_get_name(remote_service, &service_name);
RETM_IF(res != DNSSD_ERROR_NONE, "dnssd_service_get_name fail > Error = %s", get_dns_sd_error(res));
- if(service_name != NULL && sizeof(service_name) >0)
+ if(service_name != NULL)
{
str = format_string("service name: %s", service_name);
#ifdef USE_GENLIST
res = dnssd_service_get_type(remote_service, &service_type);
RETM_IF(res != DNSSD_ERROR_NONE, "dnssd_service_get_type fail > Error = %s", get_dns_sd_error(res));
- if(service_type != NULL && sizeof(service_type) >0)
+ if(service_type != NULL)
{
str = format_string("service type: %s", service_type);
#ifdef USE_GENLIST
res = dnssd_service_get_ip(remote_service, &ipv4, &ipv6);
RETM_IF(res != DNSSD_ERROR_NONE, "dnssd_service_get_ip fail > Error = %s", get_dns_sd_error(res));
- if(ipv4 != NULL && sizeof(ipv4) >0)
+ if(ipv4 != NULL)
{
str = format_string("ipv4: %s", ipv4);
#ifdef USE_GENLIST
#endif
SAFE_DELETE(str);
}
- if(ipv6 != NULL && sizeof(ipv6) >0)
+ if(ipv6 != NULL)
{
str = format_string("ipv6: %s", ipv6);
#ifdef USE_GENLIST
{
size_t idx = 0;
char* token = strtok(a_str, delim);
+ RETVM_IF(token == NULL, NULL,"strtok failed");
- while (token)
- {
- RETVM_IF(idx >= count, NULL, "idx >= count");
- *(result + idx++) = strdup(token);
- token = strtok(0, delim);
- }
- *(result + idx) = 0;
- }
+ while (token)
+ {
+ if(idx < count)
+ {
+ *(result + idx++) = strdup(token);
+ token = strtok(0, delim);
+ }
+ else
+ {
+ break;
+ }
+ }
+ *(result + idx) = 0;;
+ }
return result;
}
itc->func.del = _gl_del_cb;
item_data *id = calloc(sizeof(item_data), 1);
+ RETVM_IF(id == NULL, NULL, "malloc failed");
+
id->index = index++;
id->text = strdup(item_text);
Elm_Object_Item* it;
this->all = (view_item*)malloc(sizeof(view_item));
+ RETM_IF(this->all == NULL, "malloc failed");
+
this->all->uri = NULL;
this->all->mime = "*/*";
//it = elm_list_item_append(this->data_list, "All", NULL, NULL, _view, this->all);
Elm_Object_Item* it;
this->image = (view_item*)malloc(sizeof(view_item));
+ RETM_IF(this->image == NULL, "malloc failed");
+
this->image->uri = NULL;
this->image->mime = "image/*";
//it = elm_list_item_append(this->data_list, "Image", NULL, NULL, _view, this->image);
Elm_Object_Item* it;
this->video = (view_item*)malloc(sizeof(view_item));
+ RETM_IF(this->video == NULL, "malloc failed");
+
this->video->uri = NULL;
this->video->mime = "video/*";
//it = elm_list_item_append(this->data_list, "Video", NULL, NULL, _view, this->video);
Elm_Object_Item* it;
this->audio = (view_item*)malloc(sizeof(view_item));
+ RETM_IF(this->audio == NULL, "malloc failed");
+
this->audio->uri = NULL;
this->audio->mime = "audio/*";
//it = elm_list_item_append(this->data_list, "Audio", NULL, NULL, _view, this->audio);
{
this->http = (view_item*)malloc(sizeof(view_item));
+ RETM_IF(this->http == NULL, "malloc failed");
+
this->http->uri = PICK_VIEW_URL_HTTP;
this->http->mime = NULL;
//it = elm_list_item_append(this->data_list, PICK_VIEW_URL_HTTP, NULL, NULL, _view, this->http);
pick_list_view_append(this, PICK_VIEW_URL_HTTP, _view, this->http);
this->https = (view_item*)malloc(sizeof(view_item));
+ RETM_IF(this->https == NULL, "malloc failed");
+
this->https->uri = PICK_VIEW_URL_HTTPS;
this->https->mime = NULL;
//it = elm_list_item_append(this->data_list, PICK_VIEW_URL_HTTPS, NULL, NULL, _view, this->https);
{
this->all = (view_item*)malloc(sizeof(view_item));
+ RETM_IF(this->all == NULL, "malloc failed");
+
this->all->uri = NULL;
this->all->mime = "*/*";
//it = elm_list_item_append(this->data_list, "All", NULL, NULL, _view, this->all);
this->image = (view_item*)malloc(sizeof(view_item));
+ RETM_IF(this->image == NULL, "malloc failed");
+
this->image->uri = NULL;
this->image->mime = "image/*";
//it = elm_list_item_append(this->data_list, "Image", NULL, NULL, _view, this->image);
this->video = (view_item*)malloc(sizeof(view_item));
+ RETM_IF(this->video == NULL, "malloc failed");
+
this->video->uri = NULL;
this->video->mime = "video/*";
//it = elm_list_item_append(this->data_list, "Video", NULL, NULL, _view, this->video);
pick_list_view_append(this, "Video", _view, this->video);
this->audio = (view_item*)malloc(sizeof(view_item));
+ RETM_IF(this->audio == NULL, "malloc failed");
+
this->audio->uri = NULL;
this->audio->mime = "audio/*";
//it = elm_list_item_append(this->data_list, "Audio", NULL, NULL, _view, this->audio);
//elm_list_clear(this->data_list);
this->bmp = (view_item*)malloc(sizeof(view_item));
+ RETM_IF(this->bmp == NULL, "malloc failed");
+
this->bmp->uri = format_string("file://%s%s", this->shared_res_path, PICK_VIEW_IMAGE_BMP);
DBG("PICK_VIEW_IMAGE_BMP:%s", this->bmp->uri);
this->bmp->mime = "image/bmp";
//elm_object_item_data_set(it, "image/bmp");
this->jpg = (view_item*)malloc(sizeof(view_item));
+ RETM_IF(this->jpg == NULL, "malloc failed");
+
this->jpg->uri = format_string("file://%s%s", this->shared_res_path, PICK_VIEW_IMAGE_JPG);
DBG("PICK_VIEW_IMAGE_JPG:%s", this->jpg->uri);
this->jpg->mime = "image/jpeg";
//elm_object_item_data_set(it, "image/jpeg");
this->gif = (view_item*)malloc(sizeof(view_item));
+ RETM_IF(this->gif == NULL, "malloc failed");
+
this->gif->uri = format_string("file://%s%s", this->shared_res_path, PICK_VIEW_IMAGE_GIF);
DBG("PICK_VIEW_IMAGE_GIF:%s", this->gif->uri);
this->gif->mime = "image/gif";
//elm_object_item_data_set(it, "image/gif");
this->png = (view_item*)malloc(sizeof(view_item));
+ RETM_IF(this->png == NULL, "malloc failed");
+
this->png->uri = format_string("file://%s%s", this->shared_res_path, PICK_VIEW_IMAGE_PNG);
DBG("PICK_VIEW_IMAGE_PNG:%s", this->png->uri);
this->png->mime = "image/png";
//elm_list_clear(this->data_list);
this->aac = (view_item*)malloc(sizeof(view_item));
+ RETM_IF(this->aac == NULL, "malloc failed");
+
this->aac->uri = format_string("file://%s%s", this->shared_res_path, PICK_VIEW_SOUND_AAC);
DBG("PICK_VIEW_SOUND_AAC:%s", this->aac->uri);
this->aac->mime = "audio/aac";
//elm_object_item_data_set(it, "image/bmp");
this->amr = (view_item*)malloc(sizeof(view_item));
+ RETM_IF(this->amr == NULL, "malloc failed");
+
this->amr->uri = format_string("file://%s%s", this->shared_res_path, PICK_VIEW_SOUND_AMR);
DBG("PICK_VIEW_SOUND_AMR:%s", this->amr->uri);
this->amr->mime = "audio/amr";
//elm_object_item_data_set(it, "image/jpeg");
this->mp3 = (view_item*)malloc(sizeof(view_item));
+ RETM_IF(this->mp3 == NULL, "malloc failed");
+
this->mp3->uri = format_string("file://%s%s", this->shared_res_path, PICK_VIEW_SOUND_MP3);
DBG("PICK_VIEW_SOUND_MP3:%s", this->mp3->uri);
this->mp3->mime = "audio/mp3";
//elm_object_item_data_set(it, "image/gif");
this->wav = (view_item*)malloc(sizeof(view_item));
+ RETM_IF(this->wav == NULL, "malloc failed");
+
this->wav->uri = format_string("file://%s%s", this->shared_res_path, PICK_VIEW_SOUND_WAV);
DBG("PICK_VIEW_SOUND_WAV:%s", this->wav->uri);
this->wav->mime = "audio/wav";
//elm_list_clear(this->data_list);
this->gp3 = (view_item*)malloc(sizeof(view_item));
+ RETM_IF(this->gp3 == NULL, "malloc failed");
+
this->gp3->uri = format_string("file://%s%s", this->shared_res_path, PICK_VIEW_VIDEO_3GP);
DBG("PICK_VIEW_VIDEO_3GP:%s", this->gp3->uri);
this->gp3->mime = "video/3gpp";
//elm_object_item_data_set(it, "image/bmp");
this->mp4 = (view_item*)malloc(sizeof(view_item));
+ RETM_IF(this->mp4 == NULL, "malloc failed");
+
this->mp4->uri = format_string("file://%s%s", this->shared_res_path, PICK_VIEW_VIDEO_MP4);
DBG("PICK_VIEW_VIDEO_MP4:%s", this->mp4->uri);
this->mp4->mime = "video/mp4";
file_path = get_resource_path(view->view->tbt_info->file_name);
view->proximity_off_image = ui_utils_create_image(view->view->layout, file_path);
- RETM_IF(NULL == view->proximity_off_image, "create of proximity_on_image failed");
+ RETM_IF_CLEANUP(NULL == view->proximity_off_image, "create of proximity_on_image failed", SAFE_DELETE(file_path));
DBG("File loaded successfull");
+ SAFE_DELETE(file_path);
elm_object_part_content_set(view->view->layout, "1cnt", view->proximity_off_image);
file_path = get_resource_path(view->view->tbt_info->extra_file_name);
view->proximity_on_image = ui_utils_create_image(view->view->layout, file_path);
- RETM_IF(NULL == view->proximity_on_image, "create of proximity_on_image failed");
+ RETM_IF_CLEANUP(NULL == view->proximity_on_image, "create of proximity_on_image failed", SAFE_DELETE(file_path));
DBG("File loaded successfull");
+ SAFE_DELETE(file_path);
elm_object_part_content_set(view->view->layout, "1cnt", view->proximity_on_image);
this->is_feature_supported = true;
- this->audio_icon = ui_utils_create_image(this->view->layout, get_resource_path("images/audio-icon.png"));
- RETVM_IF(NULL == this->audio_icon, false, "create of layout elements failed");
+ char* image_path = NULL;
+ image_path = get_resource_path("images/audio-icon.png");
+ this->audio_icon = ui_utils_create_image(this->view->layout, image_path);
+ RETVM_IF_CLEANUP(NULL == this->audio_icon, false, "create of layout elements failed", SAFE_DELETE(image_path));
+ SAFE_DELETE(image_path);
+
elm_object_part_content_set(this->view->layout, "1txt_2cnt", this->audio_icon);
if(this->view->tbt_info->apptype == TBT_APP_SOUND_VOLUME)
view = (sound_view*)data;
RETM_IF(NULL == view, "view is NULL");
- double val = elm_slider_value_get(obj);
- player_set_volume(view->player, val, val);
+ double val = 0.0;
+ val = elm_slider_value_get(obj);
+ RETM_IF(0.0 == val, "slider val is 0");
+
+ player_set_volume(view->player, val, val);
}
itc->func.del = _gl_del_cb;
item_data *id = calloc(sizeof(item_data), 1);
+ RETVM_IF(NULL == id, NULL, "calloc is failed");
+
id->index = index++;
id->text = strdup(item_text);
systemsettings_view *systemsettings_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item)
{
RETVM_IF(NULL == navi, NULL, "navi is null");
- int ret, value;
+ int ret, value = -1;
int timevalue = 0;
- bool bvalue;
+ bool bvalue = false;
systemsettings_view *this = NULL;
this = calloc(1, sizeof(systemsettings_view));
RETVM_IF(!this, NULL, "calloc failed");