From 35dd5f4f5708d1a771085b49873f03a02d40713b Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Tue, 8 Nov 2016 14:53:24 +0900 Subject: [PATCH] Fix the exception handling - Add calling ecore_shutdown() Change-Id: I9d13a58cf5e940dac6c7dd7e2bfc8c7ac1a30885 Signed-off-by: Hwankyu Jhun --- src/appcore-agent.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/appcore-agent.c b/src/appcore-agent.c index 93c685b..a33301f 100644 --- a/src/appcore-agent.c +++ b/src/appcore-agent.c @@ -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; } -- 2.7.4