From: Igor Kulaychuk Date: Thu, 24 Jan 2019 20:21:27 +0000 (+0300) Subject: Call injectLibrary() after plugin initialization X-Git-Tag: accepted/tizen/5.0/unified/20190128.061832^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ftizen_5.0;p=platform%2Fcore%2Fdotnet%2Flauncher.git Call injectLibrary() after plugin initialization Change-Id: Ief3c954196f6e41c841943f100b884d67f2a704f --- diff --git a/NativeLauncher/launcher/dotnet/dotnet_launcher.cc b/NativeLauncher/launcher/dotnet/dotnet_launcher.cc index c27f213..920092c 100644 --- a/NativeLauncher/launcher/dotnet/dotnet_launcher.cc +++ b/NativeLauncher/launcher/dotnet/dotnet_launcher.cc @@ -33,6 +33,7 @@ #include #include +#include "injection.h" #include "utils.h" #include "log.h" #include "launcher.h" @@ -257,6 +258,14 @@ CoreRuntime::~CoreRuntime() int CoreRuntime::initialize(bool standalone) { + // checkInjection checks dotnet-launcher run mode, + // if it contains DOTNET_LAUNCHER_INJECT variable, it injects library. + // At the moment, this mechanism is used only when the Memory Profiler is started. + int res = checkInjection(); + if (res != 0) { + _ERR("Failed to initnialize Memory Profiler"); + return -1; + } #define __XSTR(x) #x #define __STR(x) __XSTR(x) diff --git a/NativeLauncher/launcher/main.cc b/NativeLauncher/launcher/main.cc index 3db30b3..17f69ab 100644 --- a/NativeLauncher/launcher/main.cc +++ b/NativeLauncher/launcher/main.cc @@ -14,7 +14,6 @@ * limitations under the License. */ -#include "injection.h" #include "dotnet/dotnet_launcher.h" #include "utils.h" #include "log.h" @@ -35,14 +34,6 @@ static std::string StandaloneOption("--standalone"); extern "C" int realMain(int argc, char *argv[], const char* mode) { - // checkInjection checks dotnet-launcher run mode, - // if it contains DOTNET_LAUNCHER_INJECT variable, it injects library. - // At the moment, this mechanism is used only when the Memory Profiler is started. - int res = checkInjection(); - if (res != 0) { - return 1; - } - int i; bool standaloneMode = false; char* standalonePath = nullptr;