From d31dd71a0a72bcf3d95bb635d6598d1b874a0752 Mon Sep 17 00:00:00 2001 From: Woongsuk Cho Date: Thu, 26 Mar 2020 12:40:20 +0900 Subject: [PATCH] call ecore_init() in the CoreRuntime constructor. ecore_init() must called before CoreRuntime initialization. But, sometimes, calling ecore_init() is missed by mistake. In order to prevent this mistake, call ecore_init() in the constructor of CoreRuntime. --- NativeLauncher/launcher/dotnet/dotnet_launcher.cc | 5 +++++ NativeLauncher/launcher/main.cc | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/NativeLauncher/launcher/dotnet/dotnet_launcher.cc b/NativeLauncher/launcher/dotnet/dotnet_launcher.cc index 9e3a077..e6d3bc7 100644 --- a/NativeLauncher/launcher/dotnet/dotnet_launcher.cc +++ b/NativeLauncher/launcher/dotnet/dotnet_launcher.cc @@ -37,6 +37,8 @@ #include #include +#include + #include "injection.h" #include "utils.h" #include "log.h" @@ -283,6 +285,9 @@ CoreRuntime::CoreRuntime(const char* mode) : { _INFO("Constructor called!!"); + // Intiailize ecore first (signal handlers, etc.) before runtime init. + ecore_init(); + char *env = nullptr; env = getenv("CORECLR_ENABLE_PROFILING"); if (env != nullptr && !strcmp(env, "1")) { diff --git a/NativeLauncher/launcher/main.cc b/NativeLauncher/launcher/main.cc index 548b2e6..3645320 100644 --- a/NativeLauncher/launcher/main.cc +++ b/NativeLauncher/launcher/main.cc @@ -22,7 +22,6 @@ #include #include -#include #include #include #include @@ -74,9 +73,6 @@ extern "C" int realMain(int argc, char *argv[], const char* mode) std::unique_ptr runtime(new CoreRuntime(mode)); - // Intiailize ecore first (signal handlers, etc.) before runtime init. - ecore_init(); - if (corerunMode) { _INFO("##### Run in corerun mode #####"); char appId[APPID_MAX_LENGTH] = {0,}; -- 2.7.4