modify code related to app life-cycle. 28/45528/3 accepted/tizen/mobile/20150814.011524 accepted/tizen/tv/20150814.011703 accepted/tizen/wearable/20150814.011850 submit/tizen/20150811.103743 submit/tizen/20150813.130512 submit/tizen_mobile/20150812.025625
authorJiwoong Im <jiwoong.im@samsung.com>
Fri, 7 Aug 2015 06:39:06 +0000 (15:39 +0900)
committerJiwoong Im <jiwoong.im@samsung.com>
Fri, 7 Aug 2015 07:51:01 +0000 (16:51 +0900)
- fix bug in calling resume_cb at first launch.
- call pause_cb before terminate_cb

Change-Id: Ief34871cb6c465844a49046e24e5f6a472c2f55f
Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
src/appcore-efl.c

index 713c39e..cffd294 100644 (file)
@@ -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)