Fix the exception handling 85/96185/1 accepted/tizen/3.0/common/20161114.143102 accepted/tizen/3.0/ivi/20161110.071008 accepted/tizen/3.0/mobile/20161110.070906 accepted/tizen/3.0/tv/20161110.070928 accepted/tizen/3.0/wearable/20161110.070957 accepted/tizen/common/20161109.140332 accepted/tizen/ivi/20161110.000429 accepted/tizen/mobile/20161110.000310 accepted/tizen/tv/20161110.000353 accepted/tizen/wearable/20161110.000412 submit/tizen/20161108.071447 submit/tizen/20161109.002425 submit/tizen_3.0/20161108.071238 submit/tizen_3.0_common/20161114.081136
authorHwankyu Jhun <h.jhun@samsung.com>
Tue, 8 Nov 2016 05:53:24 +0000 (14:53 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Tue, 8 Nov 2016 05:53:24 +0000 (14:53 +0900)
- Add calling ecore_shutdown()

Change-Id: I9d13a58cf5e940dac6c7dd7e2bfc8c7ac1a30885
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/appcore-agent.c

index 93c685b..a33301f 100644 (file)
@@ -936,10 +936,16 @@ static int __before_loop(struct agent_priv *agent, int argc, char **argv)
                return -1;
        }
 
-       ecore_init();
+       if (!ecore_init()) {
+               LOGE("Failed to initialize ecore");
+               return -1;
+       }
 
        r = appcore_agent_init(&s_ops, argc, argv);
-       _retv_if(r == -1, -1);
+       if (r < 0) {
+               ecore_shutdown();
+               return -1;
+       }
 
        appcore_agent_get_app_core(&ac);
        agent->app_core = ac;
@@ -950,6 +956,7 @@ static int __before_loop(struct agent_priv *agent, int argc, char **argv)
                if (r < 0) {
                        if (agent->ops && agent->ops->terminate)
                                agent->ops->terminate(agent->ops->data);
+                       ecore_shutdown();
                        errno = ECANCELED;
                        return -1;
                }