Do not check period when instance create fail 34/144234/3 accepted/tizen/3.0/common/20170816.145248 accepted/tizen/3.0/ivi/20170816.131300 accepted/tizen/3.0/mobile/20170816.131239 accepted/tizen/3.0/tv/20170816.131312 accepted/tizen/3.0/wearable/20170816.131325 submit/tizen_3.0/20170816.055230
authorHyunho Kang <hhstark.kang@samsung.com>
Wed, 16 Aug 2017 04:44:32 +0000 (13:44 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Wed, 16 Aug 2017 05:52:07 +0000 (05:52 +0000)
Change-Id: I6870e0ff6bd93f92f100ad8a0baf6f9d84285dce
Signed-off-by: Hyunho Kang <hhstark.kang@samsung.com>
src/widget_app.c

index 50712c8..22d6920 100755 (executable)
@@ -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;
 }