From 6579f394a4eb32852cba637c38bcc74e9f9dbdb0 Mon Sep 17 00:00:00 2001 From: Jiwoong Im Date: Fri, 7 Aug 2015 15:39:06 +0900 Subject: [PATCH] modify code related to app life-cycle. - fix bug in calling resume_cb at first launch. - call pause_cb before terminate_cb Change-Id: Ief34871cb6c465844a49046e24e5f6a472c2f55f Signed-off-by: Jiwoong Im --- src/appcore-efl.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/appcore-efl.c b/src/appcore-efl.c index 713c39e..cffd294 100644 --- a/src/appcore-efl.c +++ b/src/appcore-efl.c @@ -252,9 +252,13 @@ static void __do_app(enum app_event event, void *data, bundle * b) if (!(ui->state == AS_PAUSED && event == AE_PAUSE)) __appcore_timer_del(ui); + if (ui->state == AS_DYING) { + _ERR("Skip the event in dying state"); + return; + } + if (event == AE_TERMINATE) { _DBG("[APP %d] TERMINATE", _pid); - ui->state = AS_DYING; elm_exit(); return; } @@ -325,9 +329,10 @@ static void __do_app(enum app_event event, void *data, bundle * b) ui->pending_data = NULL; } else { appcore_group_resume(); - if (ui->ops->resume) { - ui->ops->resume(ui->ops->data); - } + } + + if (ui->ops->resume) { + ui->ops->resume(ui->ops->data); } ui->state = AS_RUNNING; } @@ -833,6 +838,8 @@ static void __after_loop(struct ui_priv *ui) if (ui->ops && ui->ops->terminate) ui->ops->terminate(ui->ops->data); + ui->state = AS_DYING; + if (ui->hshow) ecore_event_handler_del(ui->hshow); if (ui->hhide) -- 2.7.4