when the coreclr receives a sigterm, it attempts to forcibly exit without checking the thread status.
As a result, there is a problem that the app-core context disappears before the mainloop.
So a SIGTERM handler is added.
Change-Id: I4baa3a401cbf50ed1e17d8169e48f517a8b73a17
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
BUNDLE_DEPS
CAPI_SYSTEM_INFO_DEPS
DLOG_DEPS
+ ECORE_DEPS
GIO_2_DEPS
SENSOR_DEPS
TTRACE_DEPS
* limitations under the License.
*/
+#include <Ecore.h>
#include <aul.h>
#include <aul_app_lifecycle.h>
#include <aul_watchdog.h>
#include <locale.h>
#include <malloc.h>
#include <sensor_internal.h>
+#include <signal.h>
#include <stdbool.h>
#include <sys/stat.h>
#include <sys/time.h>
impl_->loop_delegator_->OnLoopInit(argc, argv);
else
OnLoopInit(argc, argv);
+
+ signal(SIGTERM, [](int n) {
+ ecore_main_loop_thread_safe_call_sync(
+ [](void* data) -> void* {
+ _W("sigterm handler");
+ ecore_main_loop_quit();
+ return nullptr;
+ }, nullptr);
+ });
+
traceEnd(TTRACE_TAG_APPLICATION_MANAGER);
if (impl_->feature_ & FEATURE_BACKGROUND_MANAGEMENT)