From: Hwankyu Jhun Date: Thu, 29 Jun 2017 00:54:40 +0000 (+0900) Subject: Fix initialization for backward compatibility X-Git-Tag: submit/tizen_3.0/20170816.055230~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c15d79a78998f2e1b38f35caa7a7f98748e9f574;p=platform%2Fcore%2Fappfw%2Fapp-core.git Fix initialization for backward compatibility Change-Id: I6e79e03ad3f0162f6c071de4179d9009cbaaeb61 Signed-off-by: Hwankyu Jhun --- diff --git a/src/appcore-efl.c b/src/appcore-efl.c index d7f0db8..f154538 100644 --- a/src/appcore-efl.c +++ b/src/appcore-efl.c @@ -374,7 +374,8 @@ static void __on_resume(struct ui_priv *ui, bundle *b) __appcore_timer_del(ui); #endif - if (ui->state == AS_PAUSED || ui->state == AS_CREATED) { + if (ui->state == AS_PAUSED || ui->state == AS_CREATED || + ui->state == AS_NONE) { _DBG("[APP %d] RESUME", _pid); if (ui->ops->resume) { traceBegin(TTRACE_TAG_APPLICATION_MANAGER, @@ -1019,6 +1020,41 @@ static void __add_climsg_cb(struct ui_priv *ui) #endif } +static void __del_climsg_cb(struct ui_priv *ui) +{ + if (ui->hshow) { + ecore_event_handler_del(ui->hshow); + ui->hshow = NULL; + } + + if (ui->hhide) { + ecore_event_handler_del(ui->hhide); + ui->hhide = NULL; + } + + if (ui->hvchange) { + ecore_event_handler_del(ui->hvchange); + ui->hvchange = NULL; + } + +#if defined(WAYLAND) + if (ui->hlower) { + ecore_event_handler_del(ui->hlower); + ui->hlower = NULL; + } + + if (ui->hpvchange) { + ecore_event_handler_del(ui->hpvchange); + ui->hpvchange = NULL; + } +#elif defined(X11) + if (ui->hcmsg) { + ecore_event_handler_del(ui->hcmsg); + ui->hcmsg = NULL; + } +#endif +} + static int __before_loop(struct ui_priv *ui, int *argc, char ***argv) { int r; @@ -1072,6 +1108,7 @@ static int __before_loop(struct ui_priv *ui, int *argc, char ***argv) } LOG(LOG_DEBUG, "LAUNCH", "[%s:Platform:appcore_init:done]", ui->name); + __add_climsg_cb(ui); if (ui->ops && ui->ops->create) { traceBegin(TTRACE_TAG_APPLICATION_MANAGER, "APPCORE:CREATE"); r = ui->ops->create(ui->ops->data); @@ -1085,6 +1122,7 @@ static int __before_loop(struct ui_priv *ui, int *argc, char ***argv) ui->ops->terminate(ui->ops->data); traceEnd(TTRACE_TAG_APPLICATION_MANAGER); } + __del_climsg_cb(ui); errno = ECANCELED; return -1; } @@ -1093,8 +1131,6 @@ static int __before_loop(struct ui_priv *ui, int *argc, char ***argv) } ui->state = AS_CREATED; - __add_climsg_cb(ui); - return 0; } @@ -1121,19 +1157,7 @@ static void __after_loop(struct ui_priv *ui) ui->state = AS_DYING; - if (ui->hshow) - ecore_event_handler_del(ui->hshow); - if (ui->hhide) - ecore_event_handler_del(ui->hhide); - if (ui->hvchange) - ecore_event_handler_del(ui->hvchange); -#if defined(WAYLAND) - if (ui->hlower) - ecore_event_handler_del(ui->hlower); - if (ui->hpvchange) - ecore_event_handler_del(ui->hpvchange); -#endif - + __del_climsg_cb(ui); __appcore_timer_del(ui); __finish_wl(); elm_shutdown();