Call injectLibrary() after plugin initialization accepted/tizen_5.0_unified tizen_5.0 accepted/tizen/5.0/unified/20190128.061832 submit/tizen_5.0/20190128.005630
authorIgor Kulaychuk <i.kulaychuk@samsung.com>
Thu, 24 Jan 2019 20:21:27 +0000 (23:21 +0300)
committer조웅석/Common Platform Lab(SR)/Staff Engineer/삼성전자 <ws77.cho@samsung.com>
Thu, 24 Jan 2019 22:42:12 +0000 (07:42 +0900)
Change-Id: Ief3c954196f6e41c841943f100b884d67f2a704f

NativeLauncher/launcher/dotnet/dotnet_launcher.cc
NativeLauncher/launcher/main.cc

index c27f213..920092c 100644 (file)
@@ -33,6 +33,7 @@
 #include <storage.h>
 #include <app_common.h>
 
+#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)
 
index 3db30b3..17f69ab 100644 (file)
@@ -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;