From: Hwankyu Jhun Date: Mon, 7 Oct 2019 09:18:21 +0000 (+0900) Subject: Check if the main loop is stopped properly X-Git-Tag: submit/tizen/20191007.234536~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ab2a6c0a94d996d325f7bcb9932c2028bb551488;p=platform%2Fcore%2Fappfw%2Flaunchpad.git Check if the main loop is stopped properly If the main loop is stopped forcedly, the loader_terminate_cb callback function must not be called. Change-Id: Idb1e253e4be5a46fa1b954221f0d083bce7761a3 Signed-off-by: Hwankyu Jhun --- diff --git a/src/launchpad_lib.c b/src/launchpad_lib.c index 5ce202ed..c3f41d8b 100644 --- a/src/launchpad_lib.c +++ b/src/launchpad_lib.c @@ -54,6 +54,7 @@ static int __loader_type = LAUNCHPAD_TYPE_UNSUPPORTED; static int __loader_id; static pid_t __candidate_pid = -1; static struct sigaction __prev_sigchld; +static bool __loop_quit; static void __at_exit_to_release_bundle(void) { @@ -309,6 +310,7 @@ static void __receiver_cb(int fd) if (ret >= 0) { __loader_adapter->loop_quit(__loader_user_data); _D("[candidate] ecore main loop quit"); + __loop_quit = true; } } @@ -547,6 +549,11 @@ API int launchpad_loader_main(int argc, char **argv, _D("[candidate] ecore main loop begin"); __loader_adapter->loop_begin(__loader_user_data); + if (!__loop_quit) { + _E("[candidate] loop was stopped forcedly"); + return -1; + } + return __after_loop(); } @@ -681,4 +688,4 @@ API int launchpad_hydra_main(int argc, char **argv, } return 0; -} \ No newline at end of file +}