From 0d0c874054abb035f5246b0f7a482dc1ccb24e7c Mon Sep 17 00:00:00 2001 From: Hyunho Kang Date: Wed, 16 Aug 2017 13:44:32 +0900 Subject: [PATCH] Do not check period when instance create fail Change-Id: I6870e0ff6bd93f92f100ad8a0baf6f9d84285dce Signed-off-by: Hyunho Kang --- src/widget_app.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/widget_app.c b/src/widget_app.c index 50712c8..22d6920 100755 --- a/src/widget_app.c +++ b/src/widget_app.c @@ -513,6 +513,7 @@ static int __instance_create(widget_class_h handle, const char *id, { widget_context_s *wc = NULL; int ret = 0; + int send_ret = 0; bundle *content_info = NULL; wc = (widget_context_s *)calloc(1, sizeof(widget_context_s)); @@ -537,8 +538,11 @@ static int __instance_create(widget_class_h handle, const char *id, ret = handle->ops.create(wc, content_info, w, h, handle->user_data); if (ret < 0) { _W("Create callback resturns error(%d)", ret); - ret = __send_update_status(handle->classid, wc->id, + send_ret = __send_update_status(handle->classid, wc->id, WIDGET_INSTANCE_EVENT_CREATE_ABORTED, NULL); + if (send_ret < 0) + _E("Fail to send abort status (%d)", send_ret); + _widget_app_remove_context(wc); if (wc->id) free(wc->id); @@ -556,17 +560,17 @@ static int __instance_create(widget_class_h handle, const char *id, content = "NULL"; aul_widget_instance_add(handle->classid, id); + + if (period > 0) { + wc->period = period; + wc->periodic_timer = g_timeout_add_seconds(period, + __timeout_cb, wc); + } } if (content_info) bundle_free(content_info); - if (period > 0) { - wc->period = period; - wc->periodic_timer = g_timeout_add_seconds(period, - __timeout_cb, wc); - } - return ret; } -- 2.7.4