Clean up resources after terminate callback 44/122144/2
authorSemun Lee <semun.lee@samsung.com>
Thu, 30 Mar 2017 08:49:18 +0000 (17:49 +0900)
committerSemun Lee <semun.lee@samsung.com>
Thu, 30 Mar 2017 08:52:36 +0000 (17:52 +0900)
We should not clean up resources before app's terminate callback.

Change-Id: I88aa7f0e123a14cb0eb50ab37076819e95fa4ad0
Signed-off-by: Semun Lee <semun.lee@samsung.com>
src/ui_base/appcore_ui_base.c

index 7c4c63c..524e8cc 100644 (file)
@@ -511,23 +511,6 @@ EXPORT_API int appcore_ui_base_on_terminate(void)
        }
 
        __context.state = AS_DYING;
-       if (__context.hshow)
-               ecore_event_handler_del(__context.hshow);
-       if (__context.hhide)
-               ecore_event_handler_del(__context.hhide);
-       if (__context.hvchange)
-               ecore_event_handler_del(__context.hvchange);
-       if (__context.hlower)
-               ecore_event_handler_del(__context.hlower);
-
-       __finish_wl();
-       elm_shutdown();
-
-       /* Check loader case */
-       if (getenv("AUL_LOADER_INIT")) {
-               unsetenv("AUL_LOADER_INIT");
-               elm_shutdown();
-       }
 
        appcore_base_on_terminate();
 
@@ -736,6 +719,25 @@ EXPORT_API int appcore_ui_base_init(appcore_ui_base_ops ops, int argc, char **ar
 EXPORT_API void appcore_ui_base_fini(void)
 {
        appcore_base_fini();
+
+       if (__context.hshow)
+               ecore_event_handler_del(__context.hshow);
+       if (__context.hhide)
+               ecore_event_handler_del(__context.hhide);
+       if (__context.hvchange)
+               ecore_event_handler_del(__context.hvchange);
+       if (__context.hlower)
+               ecore_event_handler_del(__context.hlower);
+
+       __finish_wl();
+       elm_shutdown();
+
+       /* Check loader case */
+       if (getenv("AUL_LOADER_INIT")) {
+               unsetenv("AUL_LOADER_INIT");
+               elm_shutdown();
+       }
+
        free(__context.appid);
        __context.appid = NULL;
 }