diff options
author | Hwankyu Jhun <h.jhun@samsung.com> | 2016-06-15 07:29:24 +0900 |
---|---|---|
committer | Hwankyu Jhun <h.jhun@samsung.com> | 2016-06-15 07:34:04 +0900 |
commit | 05260c11c6e1e937b0eb0066be09b1c9b5391632 (patch) | |
tree | a152a94446ba28787445ce962679f852cf9fce6c /src/app_main.c | |
parent | 4a616b4cf8987bd5cd95e21b4683e7041879645d (diff) | |
download | application-05260c11c6e1e937b0eb0066be09b1c9b5391632.tar.gz application-05260c11c6e1e937b0eb0066be09b1c9b5391632.tar.bz2 application-05260c11c6e1e937b0eb0066be09b1c9b5391632.zip |
Fix the exception about the application initializationsubmit/tizen/20160615.014309accepted/tizen/wearable/20160616.001830accepted/tizen/tv/20160616.001913accepted/tizen/mobile/20160616.001857accepted/tizen/ivi/20160616.001950accepted/tizen/common/20160616.151633
Change-Id: Ideacbc59f1eda9649dd057025aaca2a80ba0a97c
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
Diffstat (limited to 'src/app_main.c')
-rw-r--r-- | src/app_main.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/app_main.c b/src/app_main.c index abc6424..2378e8a 100644 --- a/src/app_main.c +++ b/src/app_main.c @@ -724,7 +724,7 @@ static void __destroy_ui_app_context(struct ui_app_context *handle) free(handle); } -static int __create_appcore_context(struct ui_app_context *app_context, appcore_context_h *handle) +static int __create_appcore_context(struct ui_app_context *app_context, struct appcore_ops **handle) { struct appcore_ops *appcore_context; @@ -744,7 +744,7 @@ static int __create_appcore_context(struct ui_app_context *app_context, appcore_ return APP_ERROR_NONE; } -static void __destroy_appcore_context(appcore_context_h handle) +static void __destroy_appcore_context(struct appcore_ops *handle) { if (handle == NULL) return; @@ -756,6 +756,7 @@ static void __destroy_appcore_context(appcore_context_h handle) int ui_app_init(int argc, char **argv, ui_app_lifecycle_callback_s *callback, void *user_data, appcore_context_h *handle) { struct ui_app_context *app_context = NULL; + struct appcore_ops *appcore_context = NULL; int ret; if (argc < 1 || argv == NULL || callback == NULL || handle == NULL) @@ -767,10 +768,12 @@ int ui_app_init(int argc, char **argv, ui_app_lifecycle_callback_s *callback, vo if (app_state != APP_STATE_NOT_RUNNING) return app_error(APP_ERROR_ALREADY_RUNNING, __FUNCTION__, NULL); - if (__create_ui_app_context(callback, user_data, &app_context) != APP_ERROR_NONE) + ret = __create_ui_app_context(callback, user_data, &app_context); + if (ret != APP_ERROR_NONE) return app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, NULL); - if (__create_appcore_context(app_context, handle) != APP_ERROR_NONE) { + ret = __create_appcore_context(app_context, &appcore_context); + if (ret != APP_ERROR_NONE) { __destroy_ui_app_context(app_context); return app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, NULL); } @@ -778,12 +781,15 @@ int ui_app_init(int argc, char **argv, ui_app_lifecycle_callback_s *callback, vo app_state = APP_STATE_CREATING; LOGI("app_efl_init"); - ret = appcore_efl_init(app_context->app_name, &argc, &argv, *handle); + ret = appcore_efl_init(app_context->app_name, &argc, &argv, appcore_context); if (ret != APP_ERROR_NONE) { - __destroy_appcore_context(*handle); + app_state = APP_STATE_NOT_RUNNING; + __destroy_appcore_context(appcore_context); return app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, NULL); } + *handle = appcore_context; + return APP_ERROR_NONE; } |