diff options
author | Hwankyu Jhun <h.jhun@samsung.com> | 2017-08-16 21:00:39 +0900 |
---|---|---|
committer | Hwankyu Jhun <h.jhun@samsung.com> | 2017-08-17 16:59:02 +0900 |
commit | 8016d738948344a10b641644a3c05d8cfda17c9f (patch) | |
tree | 3789d20dc1b1c3447805f57e2a264f8708723741 | |
parent | 3fa629c2e616412a1bf4590ed6f6bea47a75e04f (diff) | |
download | appcore-agent-accepted/tizen_3.0_common.tar.gz appcore-agent-accepted/tizen_3.0_common.tar.bz2 appcore-agent-accepted/tizen_3.0_common.zip |
Fix service app finalizationsubmit/tizen_3.0/20170817.090741accepted/tizen/3.0/wearable/20170818.001343accepted/tizen/3.0/tv/20170818.001310accepted/tizen/3.0/mobile/20170818.001324accepted/tizen/3.0/ivi/20170818.001358accepted/tizen/3.0/common/20170818.112411tizen_3.0accepted/tizen_3.0_wearableaccepted/tizen_3.0_tvaccepted/tizen_3.0_mobileaccepted/tizen_3.0_iviaccepted/tizen_3.0_common
While calling service_app_exit() or service_app_exit_without_restart(),
the application sends the status dying event to the amd.
If the initialization is failed, the aul_finalize() API will be called
to release the resources about AUL.
Change-Id: If131f838d478c02b9dd99bd1ff61dc4147375ddf
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r-- | src/appcore-agent.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/appcore-agent.c b/src/appcore-agent.c index 0439166..2daace6 100644 --- a/src/appcore-agent.c +++ b/src/appcore-agent.c @@ -906,8 +906,10 @@ EXPORT_API int appcore_agent_init(const struct agent_ops *ops, goto err; r = aul_launch_argv_handler(argc, argv); - if (r < 0) + if (r < 0) { + aul_finalize(); goto err; + } core.ops = ops; core.state = 1; /* TODO: use enum value */ @@ -956,6 +958,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); + aul_finalize(); ecore_shutdown(); errno = ECANCELED; return -1; @@ -972,13 +975,14 @@ static void __after_loop(struct agent_priv *agent) priv.state = AGS_DYING; if (agent->ops && agent->ops->terminate) agent->ops->terminate(agent->ops->data); + aul_finalize(); ecore_shutdown(); } EXPORT_API int appcore_agent_terminate() { __del_vconf_list(); - aul_finalize(); + aul_status_update(STATUS_DYING); ecore_main_loop_thread_safe_call_sync((Ecore_Data_Cb)__exit_loop, NULL); return 0; @@ -988,6 +992,7 @@ EXPORT_API int appcore_agent_terminate_without_restart() { __del_vconf_list(); aul_status_update(STATUS_NORESTART); + aul_status_update(STATUS_DYING); ecore_main_loop_thread_safe_call_sync((Ecore_Data_Cb)__exit_loop, NULL); return 0; |