call plugin_initialize before mainloop start 12/184312/1 accepted/tizen/unified/20180718.071552 submit/tizen/20180717.071847
authorWoongsuk Cho <ws77.cho@samsung.com>
Tue, 17 Jul 2018 07:13:28 +0000 (16:13 +0900)
committerWoongsuk Cho <ws77.cho@samsung.com>
Tue, 17 Jul 2018 07:13:28 +0000 (16:13 +0900)
Change-Id: Id493273c8e5c9cee92c77d2e8779eae9ed6030b2

NativeLauncher/launcher/dotnet/dotnet_launcher.cc
NativeLauncher/launcher/dotnet/dotnet_launcher.h

index 0fb373a..676029c 100644 (file)
@@ -92,10 +92,17 @@ CoreRuntime::CoreRuntime(const char* mode) :
        __hostHandle(nullptr),
        __domainId(-1),
        fd(0),
-       __mode(mode),
        __initialized(false)
 {
        _DBG("Constructor called!!");
+
+       // plugin initialize should be called before start loader mainloop.
+       // In case of VD plugins, attaching secure zone is done in the plugin_initialize().
+       // When attaching to a secure zone, if there is a created thread, it will failed.
+       // So, plugin initialize should be called before mainloop start.
+       if (initializePluginManager(mode) < 0) {
+               _ERR("Failed to initialize PluginManager");
+       }
 }
 
 CoreRuntime::~CoreRuntime()
@@ -129,11 +136,6 @@ int CoreRuntime::initialize(bool standalone)
        putenv(const_cast<char *>("UNW_ARM_UNWIND_METHOD=6"));
 #endif // __arm__
 
-       if (initializePluginManager(__mode) < 0) {
-               _ERR("Failed to initialize PluginManager");
-               return -1;
-       }
-
        if (initializePathManager(std::string(), std::string(), std::string()) < 0) {
                _ERR("Failed to initialize PathManager");
                return -1;
index 647640a..6d32a77 100644 (file)
@@ -45,7 +45,6 @@ class CoreRuntime
                void* __hostHandle;
                unsigned int __domainId;
                int fd;
-               const char* __mode;
                bool __initialized;
 };